Technological Institute of the Philippines
938 Aurora Blvd. Cubao, Quezon City
College of Information Technology Education
ITE 012 – Computer Programming 2
Preliminary Period
Fundamentals of Programming
Name: SURNAME, FIRSTNAME MI Date:
Program / Section: Instructor: Ms. Arceli F. Salo
Assessment Task: Assessment Task 1.1
Instruction:
- Save your work as SURNAME_PrelimAssign1.DOC (Ex. SALO_PrelimAssign1.DOC and .PDF)
Problem 1:
Write a program that will let the user enter: Student Name, two Course Code, two Course
Units, and two Course Grade. The program will compute and display the student's General Weighted
Average(GWA).
1. Variables: studName, cCode1, cCode2, cUnit1, cUnit2, cGrade1, cGrade2, totUnits, gwa=0.
2. Formula: totUnits=sUnit1 + sUnit2
3. gwa= ((cGrade1*cUnits1)+( cGrade2*cUnits2))/ totUnits
SAMPLE OUTPUT
Name: Alyssa Marie Santos
Section: IT12S1
Enter student name: Alyssa Marie Santos
Enter course code 1: ITE012
Enter course unit 1: 4
Enter course grade 1: 95
Enter course code 2: ITE001
Enter course unit 2: 3
Enter course grade 2: 97
Your General Weighted Average is 1.00
Problem 2:
Take three numbers from the user and print the greatest number.
Test Data
Input the 1st number: 30
Input the 2nd number: 83
Input the 3rd number: 92
Expected Output :
The greatest: 92
Problem :. Write a Java program that reads a floating-point number and prints "zero" if the number is zero.
Otherwise, print "positive" or "negative". Add "small" if the absolute value of the number is less than 1, or
"large" if it exceeds 1,000,000.
Test Data
Input a number: 25
Expected Output :
Input value: 25
Positive number
Problem 4:
Write a Java program to find the number of days in a month.
Test Data
Input a month number: 2
Input a year: 2016
Expected Output :
February 2016 has 29 days
Assessment Tool:
This assessment will be graded using Rubric for Essay
Answer:
PROB1:
PROB2:
PROB3:
PROB 4:
“affirm that I shall not give or receive any unauthorized help
on this assignment and that all work is my own”