ITP Activity Week 8
ITP Activity Week 8
Rating: _________
Year and Section: BSIT 1-A Professor / Instructor: Prof. Herliza Estrada
Due of Submission:
Week No. 8
JAVA BASIC INPUT AND OUTPUT
1. Write a program to gauge the amount of inflation over the past year. The
program asks for the item name (such as notebook or a printer), price of the
item both one year ago and today. It estimates the inflation rate as the
difference in price divided by last year's price.
Test Output
Item name: Notebook
Price Last Year : 11.50
Price This Year: 12.50
Inflation rate of Notebook: 0.09
Test Output:
Total watt s used per hour 500
Cost Per kilowatt : 5
Total watt s used monthly : 360 000
Total kilo watts used: 360
Total Overdue: 1800
Week No. 1
OVERVIEW OF PROGRAMMING
Answer Sheet:
Number 1:
Source Code :
package itpacts;
import java.util.Scanner;
public class Week8 {
//outputs results
System.out.println("Here are the result:");
System.out.println("Item Name: " + itemName);
System.out.println("Price Last Year: " + priceLastYear);
System.out.println("Price This Year: " + priceThisYear);
System.out.println("Inflation rate of " + itemName + "this Year: " + roundOff);
}
}
Output :
Input: Here are the result:
Item Name: Notebook Item Name: Notebook
Price Last Year: 11.50 Price Last Year: 11.50
Price This Year: 12.50 Price This Year: 12.50
Inflation rate of Cellphonethis Year: 0.09
Week No. 1
OVERVIEW OF PROGRAMMING
Answer Sheet:
Source Code :
Week No. 1
OVERVIEW OF PROGRAMMING
Answer Sheet:
Source Code :
Week No. 1
OVERVIEW OF PROGRAMMING
Answer Sheet:
Number 2:
Source Code :
ppackage itpacts;
import java.util.Scanner;
public class Week8 {
Output :
Total kilowatts used per hour: 500
Cost per kilowatt: 5
Total watts used per month: 360000
Total kilowatts used: 360
Total Overdue: 1800
Week No. 1
OVERVIEW OF PROGRAMMING
Answer Sheet:
Number 2:
Source Code :
Week No. 1
OVERVIEW OF PROGRAMMING
Answer Sheet:
Number 2:
Source Code :