Programming Project 3 - Living on Mars Note: When you turn in an assignment to be...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Programming Project 3 - Living on Mars Note: When you turn in an assignment to be graded in this class, you are making the claim that you neither gave nor received assistance on the work you turned in (except, of course, assistance from the instructor or teaching assistants). Mars is not a friendly place to live. There are strong winds that settlers have to deal with. With this in mind, settlers need to build "round" houses, or houses that are in the shape of an octagon. There is no precipitation, so the roof and floors are flat. In order to plan for building their houses, the settlers want a program to calculate the rough estimate of the cost of their house based on the house wall size they pick. The program will be called MartianHouses.java. The user will enter their name and then the length of one side, s, in terms of feet of the house they wish to build. The program will calculate the base cost of the house using the formulas provided below, using the length of the side, s. area of flooring or roof = 2s²(1+√2), area of outer walls = 8.12.s total surface area = floor area + outer wall area + roof area The program will display the name of the settler and then the house's total surface area as well as the cost per square foot all on one line. The base cost per square foot is $14.50. Each calculation will be rounded to two decimal places using print formatting, printf(). After the first planet's calculations are performed and printed, the program should ask the user if they would like to continue. They will type in the word "no" if they wish to end the program. They can enter anything else to continue. If they continue, they will then be prompted to enter a new settler's name and length of the house side. Note for Gradescope Testing: • Place your scanner declaration above your loop. • Use nextLine() for all String inputs. • Remember that combining .nextLine() and .nextInt() can cause unexpected behavior (Discussed on slide 43 of Chapter 4 powerpoint) You should use nextLine().trim() for the last String input of if you would like to continue or not. • You will also need to use printf() for printing and rounding your values. Note that you will need commas in your numeric output. • You cannot use System.exit() to end your loop. You must use your loop control variable containing the value "no" to end the loop. Programming Project 3 - Living on Mars Note: When you turn in an assignment to be graded in this class, you are making the claim that you neither gave nor received assistance on the work you turned in (except, of course, assistance from the instructor or teaching assistants). Mars is not a friendly place to live. There are strong winds that settlers have to deal with. With this in mind, settlers need to build "round" houses, or houses that are in the shape of an octagon. There is no precipitation, so the roof and floors are flat. In order to plan for building their houses, the settlers want a program to calculate the rough estimate of the cost of their house based on the house wall size they pick. The program will be called MartianHouses.java. The user will enter their name and then the length of one side, s, in terms of feet of the house they wish to build. The program will calculate the base cost of the house using the formulas provided below, using the length of the side, s. area of flooring or roof = 2s²(1+√2), area of outer walls = 8.12.s total surface area = floor area + outer wall area + roof area The program will display the name of the settler and then the house's total surface area as well as the cost per square foot all on one line. The base cost per square foot is $14.50. Each calculation will be rounded to two decimal places using print formatting, printf(). After the first planet's calculations are performed and printed, the program should ask the user if they would like to continue. They will type in the word "no" if they wish to end the program. They can enter anything else to continue. If they continue, they will then be prompted to enter a new settler's name and length of the house side. Note for Gradescope Testing: • Place your scanner declaration above your loop. • Use nextLine() for all String inputs. • Remember that combining .nextLine() and .nextInt() can cause unexpected behavior (Discussed on slide 43 of Chapter 4 powerpoint) You should use nextLine().trim() for the last String input of if you would like to continue or not. • You will also need to use printf() for printing and rounding your values. Note that you will need commas in your numeric output. • You cannot use System.exit() to end your loop. You must use your loop control variable containing the value "no" to end the loop.
Expert Answer:
Answer rating: 100% (QA)
Heres a Java program named MartianHousesjava that implements the requirements you provided import ja... View the full answer
Related Book For
Government and Not for Profit Accounting Concepts and Practices
ISBN: 978-1118155974
6th edition
Authors: Michael H. Granof, Saleha B. Khumawala
Posted Date:
Students also viewed these programming questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
How can we measure a security's contribution to the risk of the market portfolio?
-
Refer to the information in Problem 17-43. Suppose that Spelling Sports uses the FIFO method instead of the weighted-average method. Assume that all other information, including the cost of beginning...
-
Convert the integral to an equivalent integral in cylindrical coordinates and evaluate the result. V1-y [[[[ 0 0 (x + y2) dz dx dy
-
What is the default filename that make will process if no other is given?
-
Bramlett Company has several divisions and just built a new plant with a capacity of 20,000 units of a new product. A standard costing system has been introduced to aid in evaluating managers...
-
You have just been named Director of Data Administration of General Hardware Co. General Hardware maintains a large central IS organization with several operational relational databases at its...
-
Amherst Networking Systems adjusts and closes its books and then prepares financial statements monthly. Amherst uses the perpetual inventory system and all sales on credit have terms of n/30. The...
-
Zoe comes to your firm for legal representation. Please write an essay for Zoe, arguing for him and against Bob. Please discuss as many issues as you like as to why Zoe should be able to recover from...
-
Astrid has a $150,000 single-family rental house that was put into service on January 1, 2022. The land value of the lot is $20,000 and at the time of purchase she made $5,000 in capital...
-
Briefly, explain how BSC accounts for the $250,000 received from Ober upon contract signing?
-
Write a Bash script that translates a decimal number to its corresponding binary format.
-
Karim Corp. requires a minimum $9,600 cash balance. Loans taken to meet this requirement cost 1% interest per month (paid monthly). Any excess cash is used to repay loans at month-end. The cash...
-
Suppose you learn of a gamble in which your $1 investment (current price of investment) can either grow to $5 with 10% chance or decline to 50 cents with 90% chance. Assuming the risk-free rate to be...
-
Identify the items A-F in the process of cellular respiration below. D A E C (Organelle) F A v [ Choose ] Chloroplast Mitochondria Water B Carbon dioxide ATP energy Oxygen Glucose sugar Light energy...
-
1. Firms may hold financial assets to earn returns. How the firm would classify financial assets? What treatment will such financial assets get in the financial statements in accordance with US GAAP...
-
A governments unassigned fund balance in the general fund at year-end should be indicative of the amount that the government has available for appropriation in future years. Explain and provide an...
-
The following is an excerpt (with dates changed) from Against the Grain, a series of recommendations by the State Comptroller of Texas as to how to save $4.5 billion and thereby balance the states...
-
What are the four main types of reports required of a single audit?
-
KK Pty Ltd is a small manufacturing business. For the year ending 30 June 2019, the company achieved sales of $2 772 000 and a gross profit margin of 30%. Although satisfied with this result,...
-
The following actual balance sheet was prepared for Colombo Clocks Ltd as at 31 March 2020. At 31 March you are also provided with the following information. 1. Sales forecasts available for 2020:...
-
Fab and Fast Ltd buys and sells motor vehicle accessories. The firms estimated sales and expenses for the first 4 months of 2020 are shown below. Actual sales for December 2019 were $900 000 and...
Study smarter with the SolutionInn App