Assignment 8 Design an application that ask the user for an

Assignment 8: Design an application that ask the user for an integer number, the application is going to report if the number, is divisible with number 5. Assignment 9: Design an application that receives two real numbers in the) of 1-9 determine if the product of these is greater than 50 or not. Assignment 10: Design an application that receives two real numbers in the) of 1-9, the application is going to determine if first number is greater than, equal to or less than the second number. The application is also provide the multiplied value of square of each of the number. Assignment 11: The application is going to receive a number 0-29. The application is going to report if the given number is in the) of 0-9, 10-19, 20-29.

Solution

HI, You have not mentioned about programming language.

Please try to mention each details.

I have implemented in Java.

public class App{

  

   // Assignment 8

   public static void assignment8(int x){

       if(x%5 == 0)

           System.out.println(\"divisible by 5\");

       else

           System.out.println(\"Not divisible by 5\");

   }

  

   //Assignment 9

   // Precondition :x and y shouldbe in range 1-9

   public static void assignment9(int x, int y){

       if(x*y > 50)

           System.out.println(\"Product is greater than 50\");

       else

           System.out.println(\"Product is not greater than 50\");

   }

  

   //Assignment 10

   // Precondition: x and y should be in range 1-9

   public static void assignment10(int x, int y){

       if(x > y)

           System.out.println(\"first is greater than second\");

       else if(x < y)

           System.out.println(\"first is lesser than second\");

       else

           System.out.println(\"first and second are equal\");

      

       System.out.println(\"multiplication of square of first and second: \"+(x*x * y*y));

   }

  

   //Assignment 10

   // Precondition: x should be in range 0-29

   public static void assignment11(int x){

       if(x >=0 && x <=9)

           System.out.println(\"input is in range 0 -9\");

       else if(x>=10 && x <=19)

           System.out.println(\"input is in range 10 -19\");

       else if(x>=20 && x>=29)

           System.out.println(\"input is in range 20 -29\");

   }

  

   public static void main(String[] args) {

      

       assignment8(15);

       assignment9(4, 7);

       assignment10(2, 8);

       assignment11(18);

      

   }

}

/*

Sample run:

divisible by 5

Product is not greater than 50

first is lesser than second

multiplication of square of first and second: 256

input is in range 10 -19

*/

 Assignment 8: Design an application that ask the user for an integer number, the application is going to report if the number, is divisible with number 5. Assi
 Assignment 8: Design an application that ask the user for an integer number, the application is going to report if the number, is divisible with number 5. Assi
 Assignment 8: Design an application that ask the user for an integer number, the application is going to report if the number, is divisible with number 5. Assi

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site