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

CSC 1301 - Spring 2018 Hom Due 04/02//2018 Submission Requirements You should wr

ID: 3739207 • Letter: C

Question

CSC 1301 - Spring 2018 Hom Due 04/02//2018 Submission Requirements You should write the answers in your computer and printed screenshot of your work at the specified date b receive credit for Homework! You may discuss the assignments with other studentsi academic honesty policy) your written answers must be If you have any questions, please do not hesitate to email Chapter 4 Conditional Execution 1. 125 pts]: Describe a problem with the following code: Scanner console new Scanner(System.in); System.out.print ("What is your favorite color?"): string name = console.next(); if (name "blue") ( System.out.println( "Mine, tool") 2.125 pts]: Write a method called evenSumMax that accep a parameter. The method should prompt the user for a nun the integer that many times. Once the user has entered all t print the sum of all the even numbers the user typed, along typed. You may assume that the user will type at least one Here is an example dialogue:

Explanation / Answer

Ans:1

The correct code is below..

================================================================


import java.util.Scanner;

public class Test
{
   public static void main (String[] args)
   {
        Scanner console = new Scanner(System.in);
      
        String name = console.next();
      
        //if(name == "blue")
        if(name.equals("blue"))
       System.out.println("Mine, too!");
   }
}

==================================================================

Ans:2

Actually i have not read the question 2nd before attempting question 1 but i think question 2 is not complete it's croped and also the sample dialogue is missing. Please upload the second part again. Thank you..!!!