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

  Redesign the grading program as an object-oriented design

redesign the grading program as an object-oriented design. We will start with a simple Student class. The student will have a name, an id (as a String) and a set of grades (as doubles)

  Difference between a java compiler and a java interpreter

Write a user-defined class called Person. This class should have private instance variables defined as:

  Write a java program that uses a search tree of strings

Write a Java program that uses a search tree of strings to sort text lines in alphabetic order. You may choose how you de?ne alphabetic order as long as there is some sense in the de?nition. You may also choose what kind of tree you use.

  Write a program that reads in investment amount

Write a program that reads in investment amount, annual interest rate, and number of years and displays the future investment value

  Create a structure named dog with a string field

Create a Structure named dog with a string field for the Dog's name. Create a Structure named Cat with a string field for the Cat's name.

  Create a form that contains a guessing game

Create a Form that contains a guessing game with five RadioButtons numbered 1 through 5.  Randomly choose one of the RadioButtons as the winning button.  When the user clicks a RadioButton, display a message indicating whether the user is correct.

  Create blackjack program in java

Create Blackjack program in Java following the instructions below must be in NetBEans

  Write a method heading for each method

Write a method heading for each method, write preconditions and postconditions for each method.

  Xml assignment help please follow instructions in the

please follow instructions in the attached assignment instructions. ltbrgtplease follow instructions in the attached

  Create an intuitive interface for the user

Create an intuitive interface for the user. Create an easy to read report layout (consistent spaces for each column and column headers) for the daily report (HINT: column headers you can use...auto info, price/discounted price, customer info).

  Determine values of the side of triangle

Enter 3 integers and determine if these 3 values make up the sides of a triangle. If any side is

  Design a program in pseudocode

Design a program in pseudocode that solves this problem. You are required to generate only the pseudocode - No charting or analysis section is required, but you may have to incorporate the bubble sort algorithm to determine the minimum and maximum..

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