1.16 LAB: 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 * 0.051) / 12 (Note: Output directly. Do not store in a variable.).
Ex: If the input is:
200000 210000
the output is:
This house is $200000. The change is $-10000 since last month.
The estimated monthly mortgage is $850.0.
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.
import java.util.Scanner;
public class LabProgram {
public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
int currentPrice;
int lastMonthsPrice;
currentPrice = scnr.nextInt();
lastMonthsPrice = scnr.nextInt();
/* Type your code here. */
}

Answers

Answer 1

Answer:

Please find the complete code and the output in the attachement.

Explanation:

In the code, a class "LabProgram" is defined, and inside the main method two integer variable "currentPrice and lastMonthsPrice" is defined that uses the scanner class object is used for a user input value, and in the next step, two print method is declared that print the calculate of the integer variable.

1.16 LAB: Input And Formatted Output: House Real Estate Summary Sites Like Zillow Get Input About House
Answer 2

The program is an illustration of output formats in Java

The statements that complete the program are:

System.out.printf("This house is $%d. The change is $%d since last month.\n",currentPrice,(currentPrice - lastMonthsPrice));System.out.printf("The estimated monthly mortgage is $%.1f.\n",(currentPrice * 0.051)/12);

To format outputs in Java programming language, we make use of the printf statement, followed by the string literal that formats the required output

Take for instance:

To output a float value to 2 decimal place, we make use of the literal "%.2f"

Read more about Java programs at:

https://brainly.com/question/25458754


Related Questions

Gamification and virtual reality is the future of education

Answers

Answer:

Education is expected to be the fourth largest sector for VR investment. VR in education is predicted to be a $200 million industry by 2020, and a $700 million industry by 2025. 97% of students would like to study a VR course.

Explanation:

Write the command and explain about each formula in MS Excel


1. SUM

2. AVERAGE

3. MAx

4. MIN

5. COUNT

Answers

Answer:

1. SUM  --- The SUM function is used to sum all the values that are in a given range. Thus, for example, if you want to add the values between cells A1 and A3, you must write the following command: =SUM(A1:A10)

2. AVERAGE  --- The AVERAGE function allows you to average a range of values, throwing the average of these values in the cell where the function is typed. For example, if you want to average the values included between B1 and B3, you should write the following function: =AVERAGE (B1: B3).

3. MAX --- The MAX function, for its part, returns the maximum value of the values included in the function. For example, if the maximum value included between the values C1 and C3 is known, the following function must be written: =MAX (C1: C3).

4. MIN  --- The MIN function, in turn, allows to identify the minimum value of the range of values included in the function. For example, if the minimum value included between the values D1 and D3 is known, the following function must be written: =MIN (D1: D3).

5. COUNT --- The COUNT function, finally, is used to count all the cells that have numbers, which have been included in the range of the function. For example, if you want to count all cells that contain numbers between the values E1 and E3, you must write the following function: =COUNT (E1: E3).

What email program would you suggest and why?

Answers

Answer:

An email program

Explanation:

And why?

Answer:

I would suggest g m a i l.

Explanation:

I use G m a i l all the time and I think it is easy to use! A lot of people think it is great too! :)

Any1??
Write the names of atleast 22 high-level programming languages

Answers

Answer:

1 Array languages

2 Assembly languages

3 Authoring languages

4 Constraint programming languages

5 Command line interface languages

6 Compiled languages

7 Concurrent languages

8 Curly-bracket languages

9 Dataflow languages

10 Data-oriented languages

11 Decision table languages

12 Declarative languages

13 Embeddable languages

13.1 In source code

13.1.1 Server side

13.1.2 Client side

13.2 In object code

14 Educational languages

15 Esoteric languages

16 Extension languages

17 Fourth-generation languages

18 Functional languages

18.1 Pure

18.2 Impure

19 Hardware description languages

19.1 HDLs for analog circuit design

19.2 HDLs for digital circuit design

20 Imperative languages

21 Interactive mode languages

22 Interpreted languages

23 Iterative languages

Explanation:

What effect would excluding quotation marks from a search phrase have?
A.
It would narrow down the search.
B.
It would have little or no impact on the search.
C.
It would broaden the search.
D.
It would cause the search engine to bring up very different results.

Answers

Answer: C

 it would broaden the search

Explanation:

Placing quotation marks around a search term or phrase limits your search to that exact term or phrase. Without the quotes, your search engine may return all results that contain each separate word. Placing AND between your keywords will return results that only include both or all your keywords.

Answer:

The answer is C. It would broaden the search.

Explanation:

I got it right on the Edmentum test.

what is the significance of the following terms A A L U control unit in the CPU​

Answers

Answer:

Explanation:

The function of ALU is to perform arithmetic operations(add,subtract, multiply,division) as well as logical operations(compare values).

The function of CU is to control and coordinate the activities of the computer.

How to do brainliest

Answers

If the reply that someone put has a blue crown you click it and it will give them brainliest but it usually won’t work unless there are two answers

Identify the correct characteristics of Python lists. Check all that apply. Python lists are enclosed in curly braces { }. Python lists contain items separated by commas. Python lists are versatile Python data types. Python lists may use single quotes, double quotes, or no quotes.

Answers

Answer:

Python lists contain items separated by commas.

Python lists are versatile Python data types.

Python lists may uses single quotes, double quotes, or no quotes.

Explanation:

Python Lists are enclosed in regular brackets [ ], not curly brackets { }, so this is not a correct characteristic.

Answer:

a c d

Explanation:

/* missing precondition */

public String getChar(String str, int n) {

return str.substring(n, n 1); }

Write down the most appropriate precondition for the method so that it does not throw an exception.

Answers

Answer:

An appropriate precondition is:

0 <= n && n <= str.length() - 1

Explanation:

Required:

Write down an appropriate pre-condition for the program

From the question, we understand that the method accepts two parameters:

str -> A string value

n -> An integer value which represents the index of character to return from the string str

It should be noted that:

n must be within the range of 0 and str.length()-1

Take for instance:

str = "ABCDE";

n must be within the range 0 to 4 (inclusive) in order not to raise an exception. This is so because the string index starts at 0 and stops at 1 less than the length of the string.

Hence, the precondition can be written as:

0 <= n && n <= str.length() - 1

Which means: n = 0 to length - 1

Write a class called TextProcessor that implements the methods listed below. Your implementation may use the charAt() and length() methods from the String class You must not use any other String methods, and you must not use any of the methods in the Character class. You may not use any integer literal values except for 0 and 1.

Answers

Ieisiwizudhrhejwjjsjrjrjje

Write a program that reads an integer between o and 1000 and adds all the digits in the integer. For example, if an integer is 932, the sum of all the digits is 14. Hint: Use the % operator to extract digits, and use the / operator to remove the extracted digit. For instance, 932 % 10=2 and 932/10 =93. Here is a sample run:
Enter a number between 0 and 1000 : 999
The sum of digits is 27.

Answers

Answer:

Answered below

Explanation:

#Program is written in Python programming language

digit = 0

sum = 0

num = int(input("Enter a number between 0 and 1000: ")

#Check that number is within the valid range

if num > 0 and num <= 1000:

while num != 0:

#Isolate each digit

digit = num % 10

sum = sum + digit

#Remove isolated digit from number

num = num/10

else:

print("Number is not within valid range")

#print total sum of digits

print(sum)

Write a program that has a user guess a secret number between 1 and 10. Store the secret number in a variable called secretNumber and allow the user to continually input numbers until they correctly guess what secretNumber is. Complete the method guessMyNumber that uses a while loop to ask the user for their guess and compares it againist secretNumber. For example, if secretNumber was 6, an example run of the program may look like this:_______.

Answers

Answer:

Explanation:

The following code is written in Python. It is a function called guessMyNumber and like requested creates a random number and saves it to secretNumber. Then it continuously asks the user for their guess and compares it to the secret number. If the guess is correct it exits the loop otherwise it will continue to ask for a new guess.

import random

def guessMyNumber():

   secretNumber = random.randint(1, 10)

   print(secretNumber)

   while True:

       guess = input("Enter your guess: ")

       guess = int(guess)

       if (guess == secretNumber):

           print("Congratulations you guessed correctly")

Other Questions
A game of chance involves spinning a wheel with 4 number on it. The wheel is designed so that the result of each spin Xhas the following probability distribution. 2 3 Result of a spin .x Probability : 0.50 (a) Find and interpret the mean of X. (b) Find and interpret the standard deviation of x. (c) It costs a player $5 for a single spin. The player will receive (in dollars) three times the number that appears. So the profit for one play of this game is Yeur 5. What is the mean and standard deviation of 7 Alicia volunteered to become an organ and tissue donor when she got her state ID. If Alicia dies, she can help to improve others lives. Her heart tissue, skin, bones, and veins can all be transplanted into a patient in need.Choose the words that correctly complete the sentences.A group of similar Blank make up a tissue. Several tissues make up an Blank . Whitman uses rhyming couplets, but he intentionally breaks the flow and pattern of the couplets in the last four lines of each stanza. Notice, too, that rhymes are sometimes perfect (ex: "done" and "won"), but other times the rhymes are slant or near (ex: "bells" and "trills"). Why, do you suppose, Whitman decided to subtly break the traditional pattern? I need help answer as soon as possible. Find 3.5% of 950 g. What was the reason Chief John Ross joined the Confederacy at first.I'll give brainly to the person who gives an actual reason. ITS NOT THE ONE I MARKED I ACCIDENTLY PRESSED IT BUT PLEASE HELP Need as soon as possible URGENT! LAST QUESTION OF MY HW! I've reposted this multiple times but no one has answered, please leave an explanation if you know the answer. I will give Brainliest! 1. Why is Cortes' letter a primary source?2. Is there any information in his letter that he did not actually observe? How do you reconcile this fact with the idea that this is a primary source? Can a document be partially primary and partially secondary? (i.e., written by someone who did not witness the events or experience the emotion?)3. What can you infer about Cortes motives in writing about the wonders of Tenochtitlan and the Aztecs? Why did he choose to write about the topics he addressed in this letter? Who is is intended audience, and how might that have influenced the letter?4. Using Cortes' comments in the first two paragraphs, what assumptions can you make about the wealth of the Aztec state?5. List three characteristics of the Aztec religion. What religious practice did Cortes attempt to do away with? Do you think that he could have been successful? Which of the following was made of 11 titles andenforced laws against segregation?A. Letter from a Birmingham JailB. Texas v. HernandezC. Brown vs. Board of EducationD. The Civil Rights Act of 1964 Solve each of the following problems to 3 sig figs and correct Sl units, showing all work.1. A cart with a mass of 45.0 kg is being pulled to the right with a force of 250 N giving it anacceleration of 1.30 m/s2. The wheels of the cart are locked and the cart must be dragged.a) Draw a free body diagram of the cart.b) Calculate the net force acting on the cart.c) Create a force table and fill it in.d) Find the coefficient of kinetic friction. If DF=70, find the value of x. The access code for a car's security system consists of four digits. The second digit cannot be zero and the last digit must be odd. How many different codes are available? In an electrically neutral atom of any element, there are equal numbers of A. Protons and neurons. B. electrons and procons. C. electrons and neurrons. D. atomic number and atomia mess. 5 can someone please help me its 15 points of my major grade.. what did this quote mean in ancient times? a youngsters ear is on his back; he only listens to the man who beats him 100 POINTS!!!! I WILL GIVE BRAINLIEST TO WHO ANSWERS CORRECTLY!!!!!!!!!!!!Please give a food web for a blue viper Use the domain (1/2, 1, 2, 4, 8) to plot the points on the graph for the given equation. The grid marks represent one unit,the horizontal red line represents the x-axis, and the vertical red line represents the y-axis.y = log 2 x mention the importance of child rights