Вы находитесь на странице: 1из 3

PURES COLLEGE OF TECHNOLOGY

Program + Semester Course Name Section Code


ISBA II Fundamentals of Programming (Java) IN2203-G7
Percentage Weight of Total
Type of Evaluation
Summer 2020 Evaluation
Assignment # 1-1
7%
Course Instructor
Due Date
Muhammad Waqar
Week 3 (Jun 2nd, 2020) Total Marks: /7
Aslam

Student Name: Yash Ketanbhai Shah Student ID #: 201902241

Question No. 1

Write a Java program (after declaring class and main () method) which calculates weekly income of a worker.
Assume worker works for 40 hours in a week and his hourly income is 15 $. The output of the program
should be exactly as shown below. The value of weekly, annual and monthly income should be calculated
in variables and printed at _______ in the output shown below. There are 52 weeks and 12 months in a
calendar year. This information could be used to calculate the values shown below. The program should
compile without errors if compiled on NetBeans.
Output

My hourly income is = 15 $

Number of hours per week = 40

My weekly income is = _____

My annual income is = _____

My monthly income is = _____

Specifications
• Declare hourly income and number of hours per week as variables and print first statement in output
using values in these variables. (Marks 3)
• Declare and calculate weekly, annual and monthly income in variables and print second statement
of output. (Marks 4)

Page 1 of 3
PURES COLLEGE OF TECHNOLOGY

package Salary;

public class Yash_Shah_201902241

public static void main(String[] args)

int Hourly= 15;

System.out.println("My hourly income is = " + Hourly + " $");

int Week= 40;

System.out.println("Number of hours per week = " + Week);

double Weekly= Hourly*40;

double Annual= Weekly*52;

double Monthly= Weekly*4;

System.out.println("My Weekly income is = " + Weekly + " $");

System.out.println("My Annual income is = " + Annual + " $");

System.out.println("My Monthly income is = " + Monthly + " $");

Page 2 of 3
PURES COLLEGE OF TECHNOLOGY

My hourly income is = 15 $

Number of hours per week = 40

My Weekly income is = 600.0 $

My Annual income is = 31200.0 $

My Monthly income is = 2400.0 $

Page 3 of 3

Вам также может понравиться