You are on page 1of 2

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

Bachelor of Science in Information Technology

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

Number of Candy bars sold: xxx


Cost for each Candy bars: XXX.XX
Total amount earned: xxx.xx
++++++++++++++++++++++++++++++++++++++++++++

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

Number of Baseball purchased: xxx


Cost for each Baseball: XXX.XX
Total amount spent: xxx.xx
++++++++++++++++++++++++++++++++++++++++++++

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

Cost of Soil: xxx.xx


Cost of Flower Seeds: XXX.XX
Cost of Fence: xxx.xx
Total amount spent: xxx.xx
Page 1

++++++++++++++++++++++++++++++++++++++++++++

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

Bachelor of Science in Information Technology

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

Name: Gavino Ang


Address: Sablayan Occidental Mindoro
Birthdate: August 3, 1993
Birthplace: San Jose, Occidental Mindoro
Age: 25
Contact Number: 09161767322
Father’s Name: Gavo Ang
Mother’s Name: Ginavo Ang
Elementary Graduated: San Jose Elementary School
High School Graduated: San Jose National High School
++++++++++++++++++++++++++++++++++++++++++++

5. Sum, Difference, Product and Quotient of two numbers.


Using Program 1-5. Create the given java program with a filename SpdqOfTwoNumbers. The
allotted time is 30 minutes. Ask your professor/instructor to rate your work based from the
given rubric.

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

You might also like