3 easy java homeworks

profilecutpie
homework_due_sunday.rar

HOMEWORKS due for sunday afternoon/Assign4 (1).docx

Java Assignment Ch4

(Please zip your .java, .class, and screenshots of the results in a folder, and attach to the assignments on Angel.)

4.1 (Counting positive and negative numbers and computing the average of numbers)

Write a program that reads an unspecified number of integers, determines how many positive and negative values have been read, and computes the total and average of the input values (not counting zeros). Your program ends with the input 0. Display the average as a floating-point number. Here is a sample run:

Enter an int value, the program exits if the input is 0: 1 2 -1 3 0 The number of positives is 3 The number of negatives is 1 The total is 5 The average is 1.25

4.7 (Financial application: computing future tuition)

Suppose that the tuition for a university is $10,000 this year and increases 5% every year. Write a program that computes the tuition in ten years and the total cost of four years’ worth of tuition starting ten years from now.

Tuition in ten years is 16288.946267774418 The four-year tuition in ten years is 70207.39453239122

C:\Users\EMEC\Pictures\ControlCenter4\Scan\CCI20130927.bmp

image1.jpeg