Calculate the cube of each number from starting value

Assignment Help JAVA Programming
Reference no: EM131442675

Assignment JAVA Programming

Task 1

Write a complete Java program with the following specifications:

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

• Prompt the user twice to enter two positive whole numbers, indicating starting and finishing values, first one being smaller than the second one

• Calculate the cube of each number from starting value to finishing value and then display an appropriately headered two column table with each row containing the number and its cube

• 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 Cube
2 8
3 27
4 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.

Task 2

Problem Description:

Write a Java program to solve the problem presented below. You may assume that the user will always enter valid data; you do not have to perform data validation.

The entry charges to a zoo are:
Children 5 years old and younger: free

Accompanied children from 6 to 15 years old: $2 each

Unaccompanied children from 6 to 15 years old: $5 each

Adults from 16 to 59 years old: $10 each

Seniors from 60 years and older: $8 each

An accompanied child is defined as one in a family group accompanied by an adult or a senior. An adult or senior can only count as accompanying one child from 6 to 15 years old. No limit is placed on the number of children 5 years old and younger, which is perhaps a failing on the part of the zoo authorities, but simplifies your problem. Ages are integers.

Your program will calculate and display the entry charge for each family group and also display the total takings for a sequence of groups. In this process it will correctly determine the number of accompanied children and those not counted as accompanied in each family group. It will request the user to enter the number of children (6 - 15 years old), the number of adults (16 - 59 years old) and the number of seniors (60+ years old) for each group, and it will display the entry charge for each group.

The following shows a sample run.

Enter a group? (Yes=1/No=0): 1

Enter the number of children (age 6-15): 5

Enter the number of adults (age 16-59): 2

Enter the number of seniors (age 60+): 1

Total entry charge is $44

Enter a group? (Yes=1/No=0): 1

Enter the number of children (age 6-15): 1

Enter the number of adults (age 16-59): 2

Enter the number of seniors (age 60+): 0

Total entry charge is $22

Enter a group? (Yes=1/No=0): 0

Total takings: $66

Presentation

Materials to submit for Assignment 1:

You need to submit a single zip file containing ALL of the required assignment documents including the java and class files as well as the test documents.

Requirements

To complete this assignment you might need to have covered material up to and including the topic Selection and Looping in the Text Book and Topics.

Reference no: EM131442675

Questions Cloud

Major changes in fashion during the great depression : What were the major changes in fashion during the Great Depression? Why did these changes take place, and how did they affect the fashion (couture) houses? How did designers of this time period deal with and adapt to these changes?
Changes in fashion during the great depression : What were the major changes in fashion during the Great Depression? Why did these changes take place, and how did they affect the fashion (couture) houses? How did designers of this time period deal with and adapt to these changes?
Emancipation as a war strategy in the american civil war : Why did the Union endorse emancipation as a war strategy in the American Civil War? (The goal is to account for the change in northern attitudes toward slavery in the context of the war.)
Chinese exclusion act in the reading-study folder : Examine the Bedford Digital Case Study on the Chinese Exclusion Act in the Reading & Study folder. After reading the Learning Objective and Historical Background, read the primary sources. In the Case Study Discussion Board Forum, your thread must..
Calculate the cube of each number from starting value : Calculate the cube of each number from starting value to finishing value and then display an appropriately headered two column table with each row containing the number and its cube
Identify communication methods for managers : You are a manager of a large rehabilitation center that provides short-term care rehabilitation services on an inpatient and outpatient basis. Your center is proposing a new addition of long-term care services, and with this expansion, you must hi..
Derive each consumer lifetime budget constraint : Derive each consumer's lifetime budget constraint and state the consumer's problem? What are the conditions which define the consumer's optimal choice
Is it possible to separate the content from the filmcraft : Is it possible to separate the content from the filmcraft? If art should serve beauty and truth, can great art be in the thrall of hateful ideologies? Can we still find beauty in such an ugly past? Is it reasonability "okay" to enjoy viewing such ..
Which is an example of a systems development life cycle : Which of the following is an example of a systems development life cycle? Why should you always create a project charter at the start of a project?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Which is not a component of a try block

Which of the following is NOT a component of a try block? In the case where a method might throw more than one exception type, you specify a list of potential exceptions in the method header by separating them with ______.

  Way to organize the flowers

Prepare a java program using given conditions- He wanted a way to organize the flowers that he picks for her each day and perform a few basic tasks with them, along with a few restrictions. It is our goal to help him out

  What is difference between if statement and switch statement

What are the problems faced by Java programmers who don't use layout managers? What is the difference between an if statement and a switch statement?

  Explain the graphical coordinate system in java where is

question 1 describe the graphical coordinate system in java. where is the origin? what units apply to the xy

  Write a program in java that simulates a simple line editor

Write a program in Java that simulates a simple line editor which supports the following operations

  Show running versions of the program

Show three running versions of the program in a single screen shot with 3 different size stop signs - Make the circle a red filled circle. Add 4 buttons below the Left-Right-Up-Down buttons with Red and any three other colours.

  Days alive calculator

The context for this assignment (all parts) is a ‘Days Alive Calculator' - a small desktop application for calculating the number of days someone has been alive based on the date of birth and a second date, which may be today's date or some other ..

  Create a surveyconductor application that uses your survey

Create a SurveyConductor application that uses your Survey class to conduct a survey. This could be a new class to conduct the survey in a professional manner.

  Develop java applet that will help elementary school student

Develop a Java applet that will help an elementary school student learn multiplication. Use the Math.random method or a Random object to produce two positive one-digit integers.

  Create a java application that contains methods to display

Create a Java application that contains methods to display statistics for the numbers in an array. The main method has been written and it's attached. complete the program by writing the following methods.

  Write java application that calculates the minimum for quiz

Write a Java application that calculates the minimum, maximum, and average for each quiz. Print the output results in a table format using a text area. Use loop and if statement control structures as well as Array data structure.

  Implements simulation for movie borrowing and return system

For this assignment you need to write a console application in the Java programming language which implements a simulation for a movie borrowing and return system for the video store MovieMaster. The staff at MovieMaster will need to be able to ma..

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