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
Which statement describes how to insert the IF, COUNTIF, or SUM function into a cell?
aleksley [76]

Answer:

Type an = sign in the cell, followed by the name of the function and the relevant arguments.

Explanation:

Microsoft Excel is a software application or program designed and developed by Microsoft Inc., for analyzing and visualizing spreadsheet documents. There are different types of functions used in Microsoft Excel to perform specific tasks and these includes;

1. VLOOKUP function: it's an Excel function that avails end users the ability to lookup data in a table organized vertically. Thus, it's typically used for searching values in a column.

2. SUMIF function: it is an Excel function to sum cells that meet criteria such as text, dates and numbers. This function can be used with the following logical operators; <, >, and =.

3. COUNT function: it's an Excel function to find the total number of entries in a column. For example, to count the number of entries in B1:B15; COUNT(B2:B15).

4. IF function: runs a logical test and returns one value for a TRUE result, and another for a FALSE result. For example, to fail scores that are below 40; IF (A1 < 40, "Fail", "Pass").

5. HLOOKUP function: it's an Excel function that avails end users the ability to lookup data in a table organized horizontally. Thus, it's typically used for searching values in a column.

In Microsoft Excel, to insert the IF, COUNTIF, or SUM function into a cell, you should type an equal to (=) sign in the cell, followed by the name of the particular function and the relevant arguments.

For example, to use the SUMIF function, you should type; =SUMIF(A2:B5, "Peter", C1:C9).

7 0
3 years ago
Who would use a CLI? (Command Line Interface)
JulijaS [17]
CLIs are often used by programmers and system administrators, in engineering and scientific environments, and by technically advanced personal computer users.
7 0
3 years ago
How can i become an ailen?
DIA [1.3K]
Go to a different state as a migrant and then your a alien
8 0
3 years ago
Read 2 more answers
What is the definition of posture<br>​
Vinvika [58]

Answer:

The posture is how someone sits at his or her computer.

Hope this helps ;-))

6 0
3 years ago
Como hago para poner brainly en español???
Lelu [443]
Mentely es eso espero q te ayude :)
4 0
3 years ago
Read 2 more answers
Other questions:
  • A computer-aided system for the collection, storage, retrieval, analysis, and presentation of spatial data of all kinds is calle
    7·1 answer
  • When u look at a green object through red glass the object will appear
    11·2 answers
  • Which wireless technology has a typical transfer rate of 1 Mbps to 3 Mbps at distances up to about 10 meters?
    7·1 answer
  • On a wireless router, what gives out IP addresses?<br> DHCP<br> DNS<br> WPA<br> WPS
    7·1 answer
  • Why when i click home on iphone i still at my grandma house
    11·2 answers
  • What is infinite recursion?
    7·1 answer
  • Along a road lies a odd number of stones placed at intervals of 10 metres. These stones have to be assembled around the middle s
    12·1 answer
  • 8.11 LAB: Filter and sort a list
    8·1 answer
  • Npesta kenos reaction
    13·2 answers
  • Everyone within a company needs to be aware of what data can do to improve business processes and how to make it happen. Which c
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!