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
A(n) ______ network is a system that attempts to imitate the behavior of the human brain. Group of answer choices advanced neura
larisa [96]

Answer:

Neural Networks

Explanation:

Neural networks are networks that mimic the behaviour of the human brain in which they tend to perform a task without been programmed with the task rule, although the neural network are artificial in nature and they often recognize patterns.

Neutral network have cell that enable them to carry out task together in order to produce a desired result and the cell can only solve a little part of tasks.

6 0
3 years ago
Write a function call it isEvenPositiveInt which takes an integer x and return true if x is positive and also even. Note isinsta
Anna11 [10]

Answer:

The program to this question as follows:

Program:

def isEvenPositiveInt(x): #defining method isEvenPositiveInt

   if x>0: #checking number is positive or not

       if x%2==0: #check true condition

           return True #return value True

       else:

           return False #return value False

   return False #return value False

print(isEvenPositiveInt(24)) #calling method and print return value

print(isEvenPositiveInt(-24)) #calling method and print return value

print(isEvenPositiveInt(23)) #calling method and print return value

Output:

True

False

False

Explanation:

In the above Python program, a method "isEvenPositiveInt" is defined, that accepts a variable "x" as its parameter, inside the method a conditional statement is used, which can be described as follows:

  • In the if block the condition "x>0" is passed, that check value is positive, if this condition is true, it will go to another if block.
  • In another, if block is defined, that checks the inserted value is even or not, if the value is even it will return "true", otherwise it will go to the else part, that returns "false".  
5 0
3 years ago
Your mother wants to purchase a larger hard drive for her computer and asks you to see what type of drive interface she has. her
Darya [45]
Your mom has what is called a Parallel ATA interface. Her computer is very old and I suggest more than just a hard drive :)
5 0
3 years ago
Read 2 more answers
you are troubleshooting an inkjet printer . users report that the printer is printing in the wrong colors. the problem just star
monitta

The likely cause of the printer printing in the wrong colors includes:

  • Ink cartridges installed in the wrong spot
  • leaking ink cartridges

<h3>What is a inkjet printer?</h3>

This refers to a computer peripheral that produces hard copies of a text document or photo by spraying droplets of ink onto paper.

In conclusion, the likely cause of the printer printing in the wrong colors includes ink cartridges installed in the wrong spot and leaking ink cartridges.

Read more about inkjet printer

brainly.com/question/4962501

#SPJ4

6 0
2 years ago
What happens once the Insert tab is used in PowerPoint to insert a chart into a presentation?
nordsb [41]

Answer:

•The user can edit the chart directly. hoped i;m right

Explanation:

6 0
3 years ago
Other questions:
  • Which of the following types of access controls do not describe a lock? (a)- Directive (b)- Physical (c)- Preventative (d)- Dete
    8·1 answer
  • What should you do before you share your information on the Internet? A. Ask a trusted adult to make sure it is safe. B. Check t
    13·1 answer
  • Write a pseudocode that will take marks of physics, chemistry and math as input, calculates the average and displays output.
    7·2 answers
  • .Write a C++ program that displays your name and address (if you value your privacy, a fictitious name and address).
    9·1 answer
  • What is the difference between an internal and an external method call? In what situation would only internal calls be needed?
    11·1 answer
  • What is an example of technology that helps support the idea of continental drift.
    15·1 answer
  • A.<br>Define a computer with its proper meaning.​
    11·2 answers
  • A job placement agency helps match job seekers with potential employers. The agency would like to design a simulation in order t
    14·1 answer
  • To print a square of star shaoe we use the following code:
    10·1 answer
  • An end-user license agreement protects _____.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!