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

CSC 112 Midterm mame I. What is the output of the program below public class pub

ID: 3675770 • Letter: C

Question

CSC 112 Midterm mame I. What is the output of the program below public class public static void main(Stringl ] args) System.out print"Here" System.out printin( There "Everywhere" System.out printlo("But not"+ "in Texas") 2) Explain the java statements label a, bc.d below Import java.Util Scanner.uti public static void main(Stringl args) double average System.out.printin Enter an integer value") x scan.nextint ) System.out printin"Enter another integer value" y -scan.nextin System.out.printin Enter a third integer value") z- scan.nextint average (x+y+z)/3 System.out.println("The result of my calculation is " + average).-.._...........-d 3) Write a program which will input an int value x, and compute and output the values of 2x and x10 as int values 4) Provide three examples of code using assignment statements where one assignment statement would result in a syntax error, one would result in a logical error, and one would result in a run- time error.

Explanation / Answer

1.
Here
There Everywhere
But not in Texas

2.
a)declaration of varibales
b) initialized for standard input
c) Getting input from standard input
d) Printing average.

3)

package com.he.capillary;

import java.util.Scanner;

public class JavaTest {

   public static void main(String[] args) {

       Scanner sc = new Scanner(System.in);
       int x = sc.nextInt();
       System.out.println(Math.pow(2, x) + " " + Math.pow(x, 10));

   }

   public void test() {
       int y = 0;
       int x = 1;

//       int 4 = x;
       int z = x / y; //Run time error

   }
}

5) charAt(size) == it will throw index out of bound

7)a

6) Byte code is code which is only underatnable by java only. It is platform independent.

8)

a) <50

b) < 29

c) < 15

d) < 56

e) -51 <= x <= 50

9)

int varibale1 =1;
       int variable2 = 1;
       int variable4 = 1;
       int variable3 = (int)Math.sqrt(variable4) - variable2;

10

public static void test1(){
       System.out.println("J*");
       System.out.println("*AVA*");
       System.out.println("*TEST*");
   }

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote