Question: Please use to first assignment in order to proceed with second assignment. Assignment 2 The objectives of this assignment are: Demonstrate you can create and

Please use to first assignment in order to proceed with second assignment.

Assignment 2

The objectives of this assignment are:

Demonstrate you can create and execute successfully a simple input and output program with simple math.

Demonstrate you can post your source program and execution results in the assignment Dropbox in the Assessment area of eCourseware.

The activities of this assignment are:

Program Assignment 2: Create a program named ShipmentDisplayYourName.

Using a Scanner object read and display using System.out.println the following data items/fields for a Shipment. Display a request line before reading the data item with scanner such as this: System.out.print( Enter the Shipment ID: );

Shipment ID: String shipId: Example:

Import Java.util.Scanner;

Scanner input = new Scanner (System.in);

String shipId;

System.out.print( Enter the Shipment ID: );

shipId = input.next();

Shipment weight: int shipWeight Example:

String shipWeight;

System.out.print( Enter the Shipment Weight: );

shipWeight = input.nextint();

Shipment volume: int shipVolume

Shipment origin station: String shipOrigin

Shipment destination station: String shipDestination

Calculate and display the a double named shipCost which is shipWeight times 10 plus shipVolume times 1.5. A double is defined and used like an int but allows decimal points.

Example: double shipCost;

Display the class name and date on a separate line.

Run your program.

Post your source program as a .java file in the Program 2 dropbox in the Assessments area of eCourseware.

Post the results of your program as a screen shot in the Program 2 Dropbox in the Assessments area of eCourseware. Or copy and paste both into a Word document and post that in the Program 2 Dropbox in the Assessments area of eCourseware.

--------------------------------------------------------------------------------------------------------------------------------------

Assignment 3

The objectives of this assignment are:

Demonstrate you can create and execute successfully a program with a loop to process multiple Shipments and use the if conditional statement and compute and display totals at the end.

Demonstrate you can post your source program and execution results in the assignment Dropbox in the Assessment area of eCourseware.

The activities of this assignment are:

Program Assignment 3: Create a program named ShipmentDisplayLoopYourName.

Create a copy of ShipmentDisplayYourName named ShipmentDisplayLoopYourName.

Modify the new program to add this functionality:

Use a while loop to process multiple Shipments.

Break out of the loop if Shipment ID entered is END or end.

Ignore Shipments with weight greater than 70 weight or volume greater than 120.

Count the number of processed Shipments.

Total up the Shipment Cost.

Display the count and total after the loop has ended.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!