Quiz_ CSC 15 Spring 2021 Exam 1-1

.pdf

School

California State University, Sacramento *

*We aren’t endorsed by this school

Course

15

Subject

Computer Science

Date

Apr 29, 2024

Type

pdf

Pages

9

Uploaded by ChancellorTapirMaster1047 on coursehero.com

9/28/21, 4:25 PM Quiz: CSC 15 Spring 2021 Exam 1 https://csus.instructure.com/courses/72516/quizzes/340451/take?preview=1 1/9 CSC 15 Spring 2021 Exam 1 This is a preview of the published version of the quiz Started: Sep 28 at 4:22pm Quiz Instructions There are some programming questions in this exam. you can only take this exam one time be sure to answer all the questions there are also multiple choice questions, true/false and fill in the blank questions manage your time to answer all the questions submit your exam only when one done. using jgrasp to do the programing questions might waste your time since you might get syntax errors. Concentrate on the solution and not the syntax. This is a closed book, closed notes exam and you may not use any digital or human assistance 5 pts Question 1 True False The work on this exam is my own and I pledge to not use any outside sources or people to help me. By clicking True I pledge that I will not cheat. 5 pts Question 2 Assume that integer variable m1 has the value 7, integer variable m2 has the value 10 an d integer variable m3 has the value zero. what would be the output of the following code segment? Note that there is only one space between the numbers in each output m1 = m1 + m2 * (3/4); m2 = m1 * 3 * 5 % 2; m3 = m1 + m2; System.out.print(m1+" "); System.out.print(m2+" "); System.out.print(m3);
9/28/21, 4:25 PM Quiz: CSC 15 Spring 2021 Exam 1 https://csus.instructure.com/courses/72516/quizzes/340451/take?preview=1 2/9 14 84 98 0 0 0 7 21 28 7 1 8 10 pts Question 3 4 public static void main(String[] args) { m2(); m1(); } // this is the beginning of the method m1 { System.out.println("The wheels on the bus"); } // end of the method m1 // this is the beginning of the method m2 { m1(); System.out.println("Go Round and Round"); m1(); }// this is the end of the method m2 1. The wheels on the bus Go Round and Round The wheels on the bus The wheels on the bus 2. The wheels on the bus The wheels on the bus Go Round and Round The wheels on the bus 3. The wheels on the bus The wheels on the bus Go Round and Round The wheels on the bus The wheels on the bus 4. The wheels on the bus The wheels on the bus Go Round and Round The wheels on the bus The wheels on the bus
9/28/21, 4:25 PM Quiz: CSC 15 Spring 2021 Exam 1 https://csus.instructure.com/courses/72516/quizzes/340451/take?preview=1 3/9 2 3 1 20 pts Question 4 Gina thinks she has a fever. In her home country, temperature is measured in Celsius but her thermometer shows her temperature in Fahrenheit . Gina wants to convert her temperature to Celsius so that she knows how high her fever is . write a program to create the following table so that she can have it as a reference to convert her temperature from Fahrenheit to Celsius The conversion formula is : c = (F - 32) * 5 / 9 ( F is the temperature in Fahrenheit) must use variables for every literal value that you use in your program. must use a class constant in your program must use a for loop must have the main method must have a method to create the table Here is a sample output Fahrenheit Celsius 97 36.111111111111114 98 36.666666666666664 99 37.22222222222222 100 37.77777777777778 101 38.333333333333336 102 38.888888888888886 103 39.44444444444444 104 40.0 Edit View Insert Format Tools Table 12pt Paragraph
9/28/21, 4:25 PM Quiz: CSC 15 Spring 2021 Exam 1 https://csus.instructure.com/courses/72516/quizzes/340451/take?preview=1 4/9 p 0 words </> 9 pts Question 5 What is the output of the following lines of code: Enter three lines of output, one per line System.out.println("\"Quotes\""); System.out.println("Slashes \\//"); System.out.println("How '\"confounding' \"\\\" it is!"); Edit View Insert Format Tools Table 12pt Paragraph
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help