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

  Descriptionyou are to write a program that determines the

descriptionyou are to write a program that determines the day of the week for new years day in the year 3000. to do

  Part-2write a program that will perform some of the basic

part-2write a program that will perform some of the basic tasks accomplished by a file integrity checker such as

  Tasks for an array of integers

Write array methods that carry out the subsequent tasks for an array of integers by completing the ArrayMethods class below. Test each method.

  Produce a java software application

You are required to use test driven development (TDD) to create your solution to the scenario. Your solution should be implemented in the Java programing language using the NetBeans IDE.

  Describe the semantics of the join method of array

Describe the semantics of the join method of Array. Describe the semantics of the slice method when it is given just one parameter.

  Create screen with one spinner containing at least two city

Create a screen with one spinner containing at least two cities. On selection of the city in the spinner, make a service call to the weather API that returns the results in XML format.

  Write a java program to demonstrate the use of iterator

Write a Java program (non-GUI preferred) to demonstrate the use of Iterator.

  Write a syntactically correct java program

Give an example from your daily life of some things that could be represented as an Array and how it could be used. Write a syntactically correct Java program to present your example: declarations, initializations and use

  When is a method static and when is it not static

when is a method static and when is it not static? when is a method void and not void? what is a constructor in programming? can you explain this and give easy

  Describes the necessary flow of your program

Create pseudocode that describes the necessary flow of your program with respect to both creating a user account and placing an order.

  Write the complete code for a public java class

Write the complete code for a public Java class called Change Machine that can hold nickels, dimes and quarters. Include a private instance variable to hold each type of coin that the machine hols.

  Your task for this project is to design a program to help a

your task for this project is to design a program to help a videorental store operatorrecord clients transactions.nbsp

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