Unsure what to do? Look at the example code already given! A big part of learning to program is learning from example co

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Unsure what to do? Look at the example code already given! A big part of learning to program is learning from example co

Post by answerhappygod »

Unsure What To Do Look At The Example Code Already Given A Big Part Of Learning To Program Is Learning From Example Co 1
Unsure What To Do Look At The Example Code Already Given A Big Part Of Learning To Program Is Learning From Example Co 1 (51.56 KiB) Viewed 53 times
Java
Unsure what to do? Look at the example code already given! A big part of learning to program is learning from example code. Always take a look at the code that you do not have to write... there is something to learn in everything! :) You will be given a string variables, favouriteColour which will be initialized for you. It will be read in using the nextLine() function. Your job is to read in one more line of input. • The next line of input will be a string. • Store this value in a new variable named dislikedColour Output has been taken care of for you! Sample input/output: Input Output red I like the colour red but not the colour blue. blue green yellow I like the colour green but not the colour yellow.

I Exit Full Screen * * POD.java + New 1 - /** 2 * POD 2.4 3 * CSCI 1105 4 5 * @author Dr. Angela Siegel 6 * @version 1.0 7 * @since 2020-05-01 8 */ 9 10. import java.util.Scanner; 11 12. public class POD { 13 public static void main(String[] args) { 14 15 //Create a Scanner object to read input from the keyboard 16 Scanner in = new Scanner(System.in); 17 18 //Declare two variables and initialize (based on input) 19 String favouriteColour = in.nextLine(); 20 21 22 || Start your work here || 23 24 25 26 27 28 29 || End your work here IL 30 31 32 //Output 33 System.out.println("I like the colour " + favouriteColour + " but not the colour". 34 35 } 36 3 ========== dislikedColour + ".");
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply