Programming Exam Answers
Essay Preview: Programming Exam Answers
Report this essay
Assignment 6 :Name : Sayed Faqir BaresMatric: 1320587    Section : 02Answer 1: x is 60The size of numbers is 30Answer 2:                                            2 and 5Answer 3:double d[] = new double [10]; d[9]=5.5;       c)    System.out.println (d[0]);                 System.out.println (d[1]);       d)int min=d[0];       for (int I = 1 ;i<10;i++)    {If (d[i]min=d[i];      }                 System.out.println (min);Answer 4:  The main cant be static because it takes nonstatic String varible Cant declare size of array like this double [100] r ; The function of length don’t take parameter.r(i) should be r[i] The function of random  take parameter.Answer 5:111111ANSWER 6:         import java.util.Scanner;public class AssignScore {        public static void main(String args[]){                Scanner input = new Scanner(System.in);                                System.out.println("Enter the number of students : " );                int size = input.nextInt();        double [] student = new double[size];                System.out.print("Enter "+size+" score : " );        for (int i = 0;i max )

max=student[i];        }               for (int i = 0 ; i= max-10)                        grade=A;                else if(student[i] >= max-20)                        grade=B;                else if (student[i] >= max-30)                        grade=C;                else if (student[i] >= max-40)                        grade=D;                else                         grade=F;            System.out.println(“Student “+i+” score is “+student[i]+”and Score is “+grade);                }        }        }ANSWER 7:import java.util.Scanner;public class CountOccurrenceOfNumbers {        public static void main(String args[]){                Scanner input = new Scanner(System.in);                                int i=-1;                 int [] student = new int [100] ;                System.out.println(“Enter the integers between 1 and 50: ” );        do        {                i++;                student[i] = input.nextInt();                        }        while (student[i] != 0);

Get Your Essay

Cite this page

Number Of Students And Double D. (July 4, 2021). Retrieved from https://www.freeessays.education/number-of-students-and-double-d-essay/