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

  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