1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Margarita [4]
3 years ago
6

Class Product {

Computers and Technology
2 answers:
KatRina [158]3 years ago
8 0

Answer:

C) 400.0: 100.0

Explanation:

prt.price = 200 and updatePrice method is called which makes it 400 & new price is as declared 100.

Both the numbers are double hence

400.0 : 100.0 is printed.

blagie [28]3 years ago
5 0

Answer:

D. Compilation Fails

Explanation:

There is an error in the program, which if not correct will hinder the successful compilation of the program and will give a compilation error

The error is at doucble newPrice = 100;

The data type has to be spelt correctly to ensure the program is executed successfully

To declare variable newPrice of type double and also initialize it to 100, the right syntax is double newPrice = 100;

After correcting the error, the program will run correctly and produce the following result:

400.0 : 100.0

At line 2 of the main method, an instance of class Product is declared "Product prt = new Product();"

This allows values to be passed between the main method and the class

In class Test

price takes its value from newPrice (in the main method)

So, when newPrice is 100.0

price = 100.0 * 2

price = 200.0

After which product.price is calculated

product.price takes its value from prt.price (in the main method)

So, when prt.price is 200.0

product.price=product.price + price (Recall that price is 200.0; as illustrated above)

product.price = 200.0 + 200.0

product.price = 400.0

At line 5 of the main method, an instance of class Test is declared "Test t = new Test ();"

The next line t.updatePrice ( prt, newPrice);  assigns the calculated values to prt and newPrice respectively

prt = 400.0

newPrice = 100.0

The output is done on the next line: System.out.println(prt.price + " : " + newPrice);

prt.Price = prt = 400.0 and newPrice = 100.0

Hence, the output will be done in the following order 400.0 : 100.0

You might be interested in
Three healthcare firms jointly own and share the same cloud resources to meet their computing needs. Which cloud model does this
Stels [109]

Answer:

yes

Explanation:

yall share the same thing

5 0
2 years ago
True or False? At any point in time, an open file has a current file pointer indicating the place where the next read or write o
mr_godi [17]

Answer:

True is the correct answer for the above question.

Explanation:

  • When any document file is opened then every point has some particular address. so there is a pointer which states that where the read operation and the write operation is going on.
  • When any person writes any program to read a file or write a file then there is a need for some variable that is pointed for the reading and the write operation.
  • The document which is used for the write data or read data is also designed and maintained by some software.
  • Hence we can say that there are needs of some variable that point the operation of the file and it is also stated from the above question. Hence the above question statement is a true statement.
5 0
3 years ago
This process can be applied to help workers choose the best telecommunications technology to do a specific task.
Lisa [10]
B. Internet Telephony would be my best guess. I'm not that good with computers. Hope this Helps :-)
4 0
3 years ago
Read 2 more answers
as the reader, you can figure out the writer's ____ based on his or her word choice and sentence structure a. purpose b. audienc
Misha Larkins [42]

Answer:

my choice purpose

Explanation:

the writer simply writes with a purpose to make his audience understand it's with the purpose that he writes

8 0
3 years ago
Selecting the Tiled windows arrangement option places the windows in a(n) _______ pattern on the screen.
Archy [21]

Answer:

Selecting the Tiled windows arrangement option places the windows in a(n) Grid pattern on the screen.

Explanation:

3 0
2 years ago
Other questions:
  • Suppose that outfile is an ofstream variable and output is to be stored in the file outputData.out. Which of the following state
    15·1 answer
  • A school principal trying to find out if parents will help buy new playground equipment shows digital leadership by.
    8·2 answers
  • Write a SELECT statement that uses an aggregate window function to get the total amount of each order. Return these columns: The
    13·1 answer
  • Recently mobile phones have been used to pay for goods in stores and supermarkets. One method
    11·1 answer
  • Xxx<br>uuuuuu<br>uuuu<br>jjnmn<br>jjh
    12·1 answer
  • What is a case in programming​
    12·1 answer
  • Have some points part 6<br>anyone know how to change my username?​
    11·2 answers
  • Project stem test 3 answers
    14·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    6·1 answer
  • The most important preinstalled software is the ______ software that allows you to use the computer the first time you turn it o
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!