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
Jlenok [28]
3 years ago
11

Write a program that uses the Purchase class in 5.13. Set the prices to the following: Oranges: 10 for $2.99 Eggs: 12 for $1.69

Apples: 3 for $1.00 Watermelons: $4.39 each Bagels: 6 for $3.50 Set the purchased quantity to the following: 2 dozen oranges, 2 dozen eggs, 20 apples, 2 watermelons, 1 dozen bagels Display the total cost of the bill
Computers and Technology
1 answer:
Xelga [282]3 years ago
5 0

Answer:

Explanation:

The following program is written in Java. Using the program code from Purchase class in 5.13 I created each one of the fruit objects. Then I set the price for each object using the setPrice method. Then I set the number of each fruit that I intended on buying with the setNumberBought method. Finally, I called each objects getTotalCost method to get the final price of each object which was all added to the totalCost instance variable. This instance variable was printed as the total cost of the bill at the end of the program. My code HIGHLIGHTED BELOW

//Entire code is in text file attached below.

//MY CODE HERE

       DecimalFormat df = new DecimalFormat("0.00");

       oranges.setPrice(10, 2.99);

       oranges.setNumberBought(2*12);

       eggs.setPrice(12, 1.69);

       eggs.setNumberBought(2*12);

       apples.setPrice(3, 1);

       apples.setNumberBought(20);

       watermelons.setPrice(1, 4.39);

       watermelons.setNumberBought(2);

       bagels.setPrice(6, 3.50);

       bagels.setNumberBought(12);

       totalCost = oranges.getTotalCost() + eggs.getTotalCost() + apples.getTotalCost() + watermelons.getTotalCost() + bagels.getTotalCost();

       System.out.println("Total Cost: $" + df.format(totalCost));

   }

}

You might be interested in
How can a user view the options for Junk E-mail?
alexdok [17]
B. by right clicking all messages in the junk email folder
8 0
3 years ago
Read 2 more answers
Grace Hopper led the development of ______, a programming language for business applications.
soldi70 [24.7K]

Answer: Machine independent programming language which is known as COBOL.

Explanation:

 Grace hopper born in 1906 in the New York city and she made the machine independent programming language idea popular all over the world. It prompted the advancement of COBOL, an early significant level programming language even used today.

Preceding joining the US Navy, Hopper done her  Ph. D in the mathematics subject from the Yale University and she was also a professor at the Vassar College.

8 0
3 years ago
Read 2 more answers
Explain why there are fundamental ideas of software engineering that apply to all types of software systems.
olasank [31]

Solution:

Because of all software systems have common quality attributes, including  

Fundamental software engineering activities.  The four basic process activities of specification, development, validation and evolution are organized differently in different development processes.  The software is implemented either by developing a program or programs or by configuring an application system. Such that at they (Software engineer) have been made keeping in mind project development. They hence, apply to all software systems and even non software systems. They are the fundamentals for any kind of project development.

Thus this is the required answer..


5 0
3 years ago
Carly is part of a community of developers. In her free time, she works on code to improve this open-source operating system. Th
mina [271]

Answer:

The answer to this question is given below in the explanation section.

Explanation

Carly is part of a community of developers. In her free time, she works on code to improve this open-source operating system. The OS she's working on is most likely are:

  1. Linux
  2. OpenBSD
  3. FreeBSD
  4. NetBSD
  5. AROS
  6. Tock
  7. FreeDOS
  8. Dragonfly BSD
  9. Qubes OS
  10. Haiku
  11. Redox
  12. ReactOS
  13. Subgraph OS
  14. osv.io
  15. ToaruOS
  16. Mezzano
  17. House
  18. Minoca OS
  19. SOS
  20. PowerNex
  21. Interim OS
  22. KolibriOS
  23. MINIX
  24. HelenOS
  25. Sculpt
  26. Harvey
  27. illumos
  28. GeckOS/A65 V2.0
  29. Serenity
  30. GNU Hurd
  31. Plan 9
  32. AquilaOS
  33. Biscuit
  34. Xv6

These are the different opensource operating systems.

3 0
3 years ago
Write a program that produces this output:
AveGali [126]

Answer:

void printC()  

{  

   int i, j;  

   for (i = 0; i < 4; i++) //i indicate row number. Here we have 5 rows

       {  

         printf("C"); //print C for every row  

         for (j = 0; j < 6; j++) //j indicate column number. Here we have 7 Rows

         {  

           if (i == 0 || i == 4) //For first and last row  

               printf("C"); //print 'CCCCCCC'

          else if (i = 1|| i= 3) //for Second forth row  

                printf("C        +      +"); //print 'C    +    +'

          else if (i = 2) For second row  

                printf("C       +++++"); //print 'C +++++'

           else

               continue; //to jump to next iteration

         }  

         printf("\n"); // print in next line

}  

}

4 0
3 years ago
Other questions:
  • What are pixels that are the exact same between multiple frames called?
    15·1 answer
  • Mr. Green maintains a spreadsheet containing data on all of his employees, including name, job profile, monthly salary, and home
    15·1 answer
  • How does an agile team maintain requirement?​
    9·2 answers
  • How many cells does the organism have?\
    5·2 answers
  • Settings to control the amount of notifications is a
    10·2 answers
  • In a ______topology, every device has exactly two neighbors for communication purposes. A failure in any cable or device can tak
    15·2 answers
  • Which of the following is the definition of registration authority ( RA)?
    10·1 answer
  • Which tab should a user click to access the Page Borders feature of Word?
    13·2 answers
  • Paisa pay is facilitated in which e commerce website​
    15·1 answer
  • How do people and computers approach problems differently
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!