Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 44.
- public class squareofinteger
- {
- public static void main(String[] args)
- {
- for(int number =1; number <= 9; number++)
- {
- int square = number*number;
- System.out.print(square+" ");
- }
- }
- }
- 46.
- public class fourstars
- {
- public static void main(String[] args)
- {
- int star;
- for(star=1; star<=4; star++)
- {
- System.out.print("*");
- }
- }
- }
- 48.
- //also change the input of double kilo to 50 and 100
- public class kilogramstopounds
- {
- public static void main(String[] args)
- {
- double kilo=10;
- double pounds;
- conversion(kilo);
- }
- public static void conversion(double kilo)
- {
- double pounds = kilo/.454;
- System.out.print(kilo + " kilograms = " + pounds + "pounds.");
- }
- }
- 50.
- public class circumference
- {
- public static void main(String [] args)
- {
- double radius = 3.2;
- double pi = 3.14159;
- double circumference = radius*2*pi;
- System.out.print("circumference = " + circumference);
- }
- }
Add Comment
Please, Sign In to add comment