0% found this document useful (0 votes)
27 views7 pages

Sheet 1

Uploaded by

Taqwa Elsayed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views7 pages

Sheet 1

Uploaded by

Taqwa Elsayed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Sheet1

:1.5
{ public class java
{ public static void main(String[] args)

;double result

;result=(9.5 * 4.5 - 2.5 * 3) / (45.5 - 3.5)

;System.out.println("The result is " +result)


}
}

:1.9
{ public class java
{ public static void main(String[] args)
; double width=4.5
; double height=7.9
; double area
;double perimeter

; area = width*height
;perimeter = 2*(width+height)

System.out.println("area is " +area+"perimeter


;is"+perimeter)
}
}

:1.11
{ public class java
{ public static void main(String[] args)

double
;The_Population_Projection_After_Five_Years
double
;The_Population_Increase_In_Five_Years
; double Current_Population= 312032486
;double Number_Of_Seconds_Per_Year

;Number_Of_Seconds_Per_Year=60*60*24*365

The_Population_Increase_In_Five_Years=(((Num
ber_Of_Seconds_Per_Year)/7)-
((Number_Of_Seconds_Per_Year)/13)+
;((Number_Of_Seconds_Per_Year)/45))*5

The_Population_Projection_After_Five_Years=Th
e_Population_Increase_In_Five_Years+Current_P
;opulation

System.out.println("Population projection after


five years
is"+The_Population_Projection_After_Five_Years
;)
}
}

:2.2
;import java.util.Scanner

{ public class ComputeAandV

{public static void main(String[] args)

;double Length
;double radius
;double area
;double volume

;Scanner input = new Scanner(System.in)


System.out.println(" please enter length\n
;radius\n ")
;)(int length =input.nextInt
;)(int radius =input.nextInt

;area = radius * radius * 3.14


;volume = area * length

System.out.println("area is"+area+"volume
;is"+volume)
}
}

:2.5
;import java.util.Scanner

{ public class ComputeAandV

{public static void main(String[] args)


;double Subtotal
;double GratuityRate
;double gratuity
;double total

;Scanner input = new Scanner(System.in)


System.out.println(" please enter gratuity
;rate\nsubtotal\n ")
;)(double GratuityRate = input.nextDouble
;)(double Subtotal = input.nextDouble

;gratuity= Subtotal*GratuityRate

;total=gratuity+Subtotal

System.out.println("Subtotal"+Subtotal+"gratuity
;is"+gratuity)
}
}

You might also like