Write a complete java program to calculate the total charge

Assignment Help JAVA Programming
Reference no: EM131906921

Assignment

Write a complete Java program with the following specifications:

Display a welcoming message such as: "Welcome to Calculator Program!"

Prompt the user twice to enter two positive whole numbers, indicating first and second values, first value being smaller than the second one Calculate the square and cube of each number from first value to second value inclusive and then display an appropriately headered three column table with each row containing the number, its square and its cube respectively

Display a farewell message such as: "Goodbye, thank you for using our program!"

As an example, if the starting and finishing values were 2 and 4 respectively, the table in the output would look something like the following:

Number   Square    Cube
2               4            8
3               9            27
4               16          64

Ensure that the program is appropriately documented throughout and thoroughly tested to demonstrate its correct operation.

You may assume that the user of the program enters the inputs as required so that no input validation or error checking is necessary.

You need to submit java and class files, a short discussion to explain the logic on how the problem has been solved, and sample output (for detail please see marking guide and presentation below).

Task 5:

Problem Description:

Write a complete Java program to calculate the total charge corresponding to purchase of books at a fictional annual book festival. The price of each book is based on its category as described below:

Large print hardback books $10 each or three for $20
Small print hardback books $7 each or two for $10
All softcover books $5 each or five for $15

An example run of the program might look like the following (user input is shown in bold):
Welcome to the annual book festival!
Enter the number of large print hardback books purchased: 4
Enter the number of small print hardback books purchased: 6
Enter the number of softcover books purchased: 7

Your total bill is: $85
Would you like to calculate another bill (y/n)? y
Enter the number of large print hardback books purchased: 6
Enter the number of small print hardback books purchased: 0
Enter the number of softcover books purchased: 10
Your total bill is: $70
Would you like to calculate another bill (y/n)? n
Total sales in this session: $155
Goodbye!

Note that the program will continue calculating bills until the user enters n in response to the last prompt asking if another calculation is required.

Ensure that the program is appropriately documented throughout and thoroughly tested to demonstrate its correct operation.

You may assume that the user of the program enters the inputs as required so that no input validation or error checking is necessary.

You need to submit java and class files, a short discussion to explain the logic on how the problem hasbeen solved, and sample output (for detail please see marking guide and presentation below).

Reference no: EM131906921

Questions Cloud

How did colonialism affect this group of people : How did colonialism affect this group of people? What problem or challenges does this group people have to deal with in the modern world?
Find the negation of quantified statements : Translate prose with quantified statements to symbolic and find the negation of quantified statements.
Movie review of 12 years a slave : You need to do Movie review of 12 years a slave
Calculate the net benefit that you brought with your action : Recall a moment when you acted as a utilitarian. Calculate the net benefit that you brought with your action by applying J. S. Mill's Principle of Utility.
Write a complete java program to calculate the total charge : Write a complete Java program to calculate the total charge corresponding to purchase of books at a fictional annual book festival.
Describe the main threats to a countrys internal security : Identify and describe the main threats to a countrys internal security as a result of globalization - Declaration on Measures to Eliminate International
What are the main ideas from the video : What is your overall opinion of the video? Do you agree with Khanna or not? Why? Explain with specific details.
Draw an Entity Relationship diagram : In this assignment, you need to perform the following tasks for the given case study: Draw an Entity Relationship (ER) diagram
Prepare the power-point presentation : Topic: Social Equity as the Fourth Pillar of Public Administration, Access to Affordable Housing for Disadvantaged Populations.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd