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=student[i]; } for (int i = 0 ; i