0% found this document useful (0 votes)
20 views

Java Assignment 1

This document provides instructions for 10 programming assignments on Java basics. The assignments include: 1) calculating the difference between the sum of squares and square of sums of n numbers, 2) calculating the perimeter of a square given its area, 3) calculating the volume of a cylinder given its radius and height, 4) calculating tax and net pay given an employee's gross pay and hourly rate, 5) calculating total profit of a movie theater given ticket price and number of attendees, 6) calculating the surface area of a cylinder given its radius and height, 7) calculating the surface area of an open cylinder (pipe) given its dimensions, 8) calculating the height reached by a rocket given its acceleration and time, 9) calculating the distance

Uploaded by

Sampad Sekhar
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Java Assignment 1

This document provides instructions for 10 programming assignments on Java basics. The assignments include: 1) calculating the difference between the sum of squares and square of sums of n numbers, 2) calculating the perimeter of a square given its area, 3) calculating the volume of a cylinder given its radius and height, 4) calculating tax and net pay given an employee's gross pay and hourly rate, 5) calculating total profit of a movie theater given ticket price and number of attendees, 6) calculating the surface area of a cylinder given its radius and height, 7) calculating the surface area of an open cylinder (pipe) given its dimensions, 8) calculating the height reached by a rocket given its acceleration and time, 9) calculating the distance

Uploaded by

Sampad Sekhar
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Java basics-Assignment 1

Assignment - In progress
Title
Due
Status
Grade Scale

Introduction to Java basics-Assignment 1


Aug 11, 2012 11:55 pm
Not Started
Points (max 10.0)

Instructions
1. Write a program to find the difference between sum of the squares and the square of the sums
of n numbers?
2. Develop a program that accepts the area of a square and will calculate its perimeter.
3. Develop the program calculateCylinderVolume., which accepts radius of a cylinder's base disk
and its height and computes the volume of the cylinder.
4. Utopias tax accountants always use programs that compute income taxes even though the tax
rate is a solid, never-changing 15%. Define the program calculateTax which determines the tax
on the gross pay. Define calculateNetPay that determines the net pay of an employee from the
number of hours worked. Assume an hourly rate of $12.
5. An old-style movie theater has a simple profit program. Each customer pays $5 per ticket.
Every performance costs the theater $20, plus $.50 per attendee. Develop the program
calculateTotalProfit that consumes the number of attendees (of a show) and calculates how much
income the show earns.
6. Develop the program calculateCylinderArea, which accepts radius of the cylinder's base disk
and its height and computes surface area of the cylinder.
7. Develop the program calculatePipeArea. It computes the surface area of a pipe, which is an
open cylinder. The program accpets three values: the pipes inner radius, its length, and the
thickness of its wall.
8. Develop the program calculateHeight, which computes the height that a rocket reaches in a
given amount of time. If the rocket accelerates at a constant rate g, it reaches a speed of g t in t
time units and a height of 1/2 * v * t where v is the speed at t.
9. Develop a program that computes the distance a boat travels across a river, given the width of
the river, the boat's speed perpendicular to the river, and the river's speed. Speed is distance/time,
and the Pythagorean Theorem is c2 = a2 + b2.

10. Develop a program that accepts an initial amount of money (called the principal), a simple
annual interest rate, and a number of months will compute the balance at the end of that time.
Assume that no additional deposits or withdrawals are made and that a month is 1/12 of a year.
Total interest is the product of the principal, the annual interest rate expressed as a decimal, and
the number of years.

Please zip your files and upload it. You can submit only one file.

You might also like