Answered step by step
Verified Expert Solution
Question
1 Approved Answer
3 . 1 5 LAB JAVA: Input and formatted output: House real estate summary Sites like Zillow get input about house prices from a database
LAB JAVA: Input and formatted output: House real estate summary
Sites like Zillow get input about house prices from a database and provide nice summaries for readers. Write a program with two
inputs, current price and last month's price both integers Then, output a summary listing the price, the change since last month, and
the estimated monthly mortgage computed as currentprice
Output each floatingpoint value with two digits after the decimal point, which can be achieved as follows:
print fyourvalue:f
Ex: If the input is:
the output is:
This house is $ The change is $ since last month.
The estimated monthly mortgage is $
Note: Getting the precise spacing, punctuation, and newlines exactly right is a key point of this assignment. Such precision is an
important part of programming LAB: Set basIcS
Given the user inputs, complete a program that does the following tasks:
Define a set, fruits, containing the user inputs: myfruit myfruit and myfruit
Add the user inputs, yourfruit and yourfruit to fruits.
Add the user input, theirfruit, to fruits.
Add yourfruit to fruits.
Remove myfruit from fruits.
Observe the output of each print statement carefully to understand what was done by each task of the program.
Note: For testing purposes, sets are printed using sorted for comparison, as in the book's examples.
Ex: If the input is:
apple
peach
lemon
apple
pear
plum
the output is:
'apple', 'lemon', 'peach'
apple 'lemon', 'peach', 'pear'
apple 'lemon', 'peach', 'pear', 'plum'
apple 'lemon', 'peach', 'pear', 'plum'
lemon 'peach', 'pear', 'plum' LAB: Instrument information derived classes
Given the base class Instrument, define a derived class StringInstrument for string instruments with a constructor that
initializes the attributes of the Instrument class as well as new attributes of the following types
integer to store the number of strings
integer to store the number of frets
boolean to store whether the instrument is bowed
Ex If the input is:
Drums
Zildjian
Guitar
Gibson
False
the output is:
Instrument Information:
Name: Drums
Manufacturer: Zildjian
Year built:
Cost:
Instrument Information:
Name: Guitar
Manufacturer: Gibson
Year built:
Cost:
Number of strings:
Number of frets:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started