Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. write aprogram to read n numbers and sum all positive numbers and count the n

ID: 3622666 • Letter: 1

Question

1. write aprogram to read n numbers and sum all positive numbers and count the numbers of negative numbers .

2. write a program to read n numbers and calculae the sum of obsolute values of these numbers.

3 write aprogram to read 100 numbers and display the largest value.

4.write aprogram to read 100 numbers and display the smallest value.

5.write aprogram to read 100 numbers and display the largest and smallest value.

6.write aprogram to read data of N student(data consists of name of student, ID student, 4 grades). for each student tour program display the student name, ID total Score , Letter Grade, the highest total score and the lowest total score

7 same as above but show for each student name ID and fails of passes.

8.write a program to read a number and repeatedly prompts to yser to enter asecund number till the secound number is multiple the first one.

9. write aprogram to dispaly menu from the following character(+,-,/,*,and Q0. When+ enterd the program prompts the user to enter 2 integer numbers then the program displys the sum of the numbers, the same idea will be applied for others but with / your program dose not accept the secound number as zero repeatedly prompt user to enter anon zero value whenQ is entered;your program end and diplay END.

Explanation / Answer

please rate - thanks

CRAMSTER rule is 1 question per post I'll do the "simple" ones

1)

import java.util.Scanner;

public class main {
public static void main(String[] args)
{Scanner in = new Scanner(System.in);
int n,i;
System.out.print("How many numbers do you have? ");
n=in.nextInt();
int sum=0,count=0,num;
for(i=0;i<n;i++)
     {System.out.print("Enter a number: ");
       num=in.nextInt();
        if(num>=0)
            sum+=num;
        else
            count++;  
    }
System.out.println("The sum of the positive numbers is: "+sum);
System.out.println("There were "+count+" negative numbers");
}       
      }

2)

import java.util.Scanner;

public class main {
public static void main(String[] args)
{Scanner in = new Scanner(System.in);
int n,i;
System.out.print("How many numbers do you have? ");
n=in.nextInt();
int sum=0,num;
for(i=0;i<n;i++)
     {System.out.print("Enter a number: ");
    num=in.nextInt();
       sum+=Math.abs(num);
       
    }
System.out.println("The sum of the absolute value of the numbers is: "+sum);

}       
      }

3)

import java.util.Scanner;

public class main {
public static void main(String[] args)
{Scanner in = new Scanner(System.in);
int i;
int sum=0,num,max;
System.out.print("Enter a number: ");
max=in.nextInt();
for(i=1;i<100;i++)
     {System.out.print("Enter a number: ");
    num=in.nextInt();
        else
    }
System.out.println("The largest number is: "+max);

}       
      }

4)

import java.util.Scanner;

public class main {
public static void main(String[] args)
{Scanner in = new Scanner(System.in);
int i;
int sum=0,num,min;
System.out.print("Enter a number: ");
min=in.nextInt();
for(i=1;i<100;i++)
     {System.out.print("Enter a number: ");
    num=in.nextInt();
         if(num<min)
             min=num;
    }
System.out.println("The smallest number is: "+min);

}       
      }

5)

import java.util.Scanner;

public class main {
public static void main(String[] args)
{Scanner in = new Scanner(System.in);
int i;
int sum=0,num,min,max;
System.out.print("Enter a number: ");
min=in.nextInt();
max=min;
for(i=1;i<100;i++)
     {System.out.print("Enter a number: ");
    num=in.nextInt();
         if(num<min)
             min=num;
        else if(num>max)
               max=num;
    }
System.out.println("The smallest number is: "+min);
System.out.println("The largest number is: "+max);
}       
      }

6)

7)

8)

import java.util.Scanner;

public class main {
public static void main(String[] args)
{Scanner in = new Scanner(System.in);
int i;
int num,min;
System.out.print("Enter a number: ");
min=in.nextInt();

System.out.print("Enter a 2nd number: ");
num=in.nextInt();

while(num%min!=0)
     {System.out.println("must be a multiple of the 1st ");
    System.out.print("Enter a 2nd number: ");
    num=in.nextInt();
    }
}       
      }

9)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Chat Now And Get Quote