Professional Documents
Culture Documents
PROGRAMMING CHALLENGES
1. Candy Bar Sales
Using Program 1-1. Write a program that calculates how much a student solving the
organization earns during its fund-raising candy sale. The program should prompt the Candy
Bar Sales user to enter the number of candy bars sold and the amount the organization earns
for Problem each bar sold. It should then calculate and display the total amount earned.
Sample output:
++++++++++++++++++++++++++++++++++++++++++++++++++++++
CANDY BAR SALES
2. Baseball Costs
Using Program 1-2. Write a program that calculates how much a Little League baseball team
spent last year to purchase new baseballs. The program should prompt the user to enter the
number of baseballs purchased and the cost of each baseball. It should then calculate and
display the total amount spent to purchase the baseballs.
Sample output:
++++++++++++++++++++++++++++++++++++++++++++++++++++++
LITTLE LEAGUE BASEBALL TEAM
3. Flower Garden
Using Program 1-3. Write a program that calculates how much a garden center spent to
make a flower garden display. The program should prompt the user to enter the cost of the
soil, the flower seeds, and the fence. It should then calculate and display the total amount
spent.
Sample output:
++++++++++++++++++++++++++++++++++++++++++++++++++++++
FLOWER GARDEN DISPLAY
++++++++++++++++++++++++++++++++++++++++++++
Computer Programming II
REPUBLIC OF THE PHILIPPINES
OCCIDENTAL MINDORO STATE COLLEGE
Sablayan, San Jose, Occidental Mindoro
website: www.omsc.edu.ph email address: omsc_9747@yahoo.com
Tele/Fax: (043) 457-0231
PROGRAMMING CHALLENGES
4. Personal Profile
Using Program 1-4. Write a program that will displays your personal profile. The allotted time
is 45 minutes to finish the activity. Ask your professor/instructor to rate your work based
from the given rubric.
Sample output:
++++++++++++++++++++++++++++++++++++++++++++++++++++++
MY PERSONAL PROFILE
import java.util.Scanner;
public class SumProd
{
Public static void main(String args [])
{
int x=150;
double y=250.455, sum, prod, diff,quo;
Scanner keyboard=new Scanner (System.in);
Sytem.out.println(“Input First Number: “);
Sytem.out.println(“The first number is “ + x );
Sytem.out.println(“Input Second Number: “);
Sytem.out.println(“The second number is “ + y );
sum = x+y;
prod = x*y;
diff = x-y;
quo = x/y;
Sytem.out.println(“The sum is “ + sum );
Sytem.out.println(“The product is “ + prod );
Sytem.out.println(“The difference is “ + diff );
Sytem.out.println(“The quotient is “ + quo );
}
Page 2
Computer Programming II