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
What is the best way to study for an exam?
cupoosta [38]

AnswerB

Explanation:Makes since to look over the notes each night before the exam

8 0
2 years ago
Look at the pic. I know what girls be going through like us girls aren't toys. Please stop, please.
mixas84 [53]

Answer:

No need to be overly-sensitive, brainly deleted that question

If no one joins then its not a problem

6 0
2 years ago
Read 2 more answers
the two main forces acting on a computer that sits on a table are _________ and _________. a. weight; gravity b. weight; mass c.
EleoNora [17]
It is A.weight: gravity
8 0
3 years ago
Read 2 more answers
Write a program whose inputs are three integers, and whose outputs are the largest of the three values and the smallest of the t
Monica [59]

Answer:

int SmallestNumber(int num1, int num2, int num3){

int smallest;

if (num1 >num2){

smallest=num2;

}

else {

smallest=num1;

}

if(smallest <num3){

smallest=num3;

}

}

int LargestNumber(int num1, int num2, int num3){

int largest;

if (num1 <num2){

largest=num2;

}

else {

largest=num1;

}

if(largest>num3){

largest=num3;

}

}

void main(){

int num1,num2,num3;

printf("enter values");

scanf("%d%d%d",&num1,&num2,&num3);

int smallest=SmallestNumber(num1,num2,num3);

int largest=LargestNumber(num1,num2,num3);

}

Explanation:

we are comparing first two numbers and finding largest among those. After getting largest comparing that with remaining if it is greater then it will be largest of three. Same logic applicable to smallest also

7 0
2 years ago
The location of a radiotelephone sensor is ______________.
Sedaia [141]
The answer is being difficult to detect. A radiotelephone is a communication system for the transmission of the speech on a radio. It is rarely connected with the landline telephone service and other radio services like the GMRS. Hope this answer would help.
8 0
3 years ago
Other questions:
  • What types of issues can you most likely resolve by knowing how to access and use the control Panel?
    15·1 answer
  • What is this tool called?
    5·2 answers
  • Which of the following types of access controls do not describe a lock? (a)- Directive (b)- Physical (c)- Preventative (d)- Dete
    8·1 answer
  • How is the Internet Simulator similar to the Actual Internet? How is it different?
    7·1 answer
  • Describe any four rights of users of information systems.
    8·1 answer
  • This term describes two or more arrays that hold related data, and the related elements in each array are accessed with a common
    15·1 answer
  • A server of service is responsible for sending the contents of cengage.com to your browser when you type cengage.com into the lo
    12·1 answer
  • Can I change my username?
    6·1 answer
  • Which of the following is true of binary files?
    6·2 answers
  • Read the following characteristic:
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!