subject

Learning Objectives:• understand when to use the differentprint statements• create a variable and assign it a value• use Scanner to read in user input• print the value of a variable usingprintfOutput:US state: TexasCapital: AustinThe capital of Texas is AustinDescription:Copy and paste the code below:/ Name:* Assignment: A01/public class A01{public static void main(String[] args){// part1System. out. print("x x x");System. out. print("x o x");System. out. print("x x x");System. out. println();// part2}}Write your name in the comment on top. The red letters in the output are the user inputs. This assignment consists of 2 parts. First you demonstrate your understanding of the different print statements by modifying acode segment. Then you read in two Strings and print a statement based on the user input. Part1:The code segment provided includesthree print statements that producethe following output:Change the code segment so that itproduces the following output:Hint: you will need to change the number ofstatementsPart2:• Prompt the user to enter a state• Read in the user response and assignit to a String variable named stateHint: before you can assign a value to thevariable state it needs to be declared• Prompt the user to enter the name ofthe capital• Read in the user response and assignit to a String variable named capital.• Use printf and format specifiers toprint the following message:The capital of state is capitalwhere you substitute state and capital withthe state and capital entered by the user. Make your output look exactly like the output displayed above. Make sure to read in the input next to the prompt but without touching it (use a blank toseparate the prompt from the user input). The output should use a single empty line toseparate the frog displayed in part1 from the output created in part2.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 23:00
Fast sportcars the top speeds of sportscars, given in miles per hour, are: 155 mph bmw m5 217 mph lamborghini aventador spyder 205 mph ferrari 488 205 mph nissan gtr 197 mph chevrolet corvette stingray zr1 258 mph bugatti veyron supersport 195 mph dodge viper 270 mph hennessey venom 155 mph bmw m3 195 mph mercedes sl given: topspeeds=[155; 217; 205; 205; 197; 258; 195; 270; 155; 195]; carnames=string(["bmw m5" "lamborghini aventador spyder" "ferrari 488" "nissan gtr" "chevrolet corvette stingray zr1" "bugatti veyron supersport" "dodge viper" "hennessey venom" "bmw m3" "mercedes sl"]); the variable is a rectangular array. write a function called selectcars to identify cars with the top speed within a given range, and display the identified names. the selected cars speed will be in a range given by lowerbound < speed < upperbound. inputs to the function selectcars are: a column array os all car top speeds named topspeeds, the corresponding chara
Answers: 2
question
Computers and Technology, 22.06.2019 23:50
You need to design a circuit that implements the functions in the following table: s0 s1 function0 0 a + 10 1 a – b1 0 a + b1 1 a – 1s0 and s1 are 1-bit control inputs to select the function of the circuit. inputs a and b are 4-bitnumbers in 2s complement form. the output is also a 4-bit number in 2s complement form.you are allowed to use only one ttl 7483 4-bit adder to implement all the functions. but anynumber of other components (except the adder) can be used.hint: design a combinational logic circuit to modify the input b and the “carry input” of theadder depending on the control inputs s0 and s1.important: lab grade will depend on the working of the circuit & will be checked of by your labinstructor.1. is the output valid for the following input combinations: a. s0 = 0, s1 = 0, a = 7, b = 3? b. s0 = 0, s1 = 1, a = 7, b = 3? c. s0 = 1, s1 = 0, a = -4, b = -5? d. s0 = 1, s1 = 1, a = -8, b = 6? 2. what is the range of inputs (for both a and b) that will produce the valid output for all the functions?
Answers: 3
question
Computers and Technology, 23.06.2019 09:00
Which best describes the role or restriction enzymes in the analysis of edna a. to break dna into fragments that vary in size so they can be sorted and analyzed b. to amplify small amounts of dna and generate large amounts of dna for analysis c. to purify samples of dna obtained from the environment so they can be analyzed d. to sort different sizes of dna fragments into a banding pattern that can be analyzed
Answers: 1
question
Computers and Technology, 23.06.2019 11:30
Me dangers of social media and the internetexplain what each means: 1) social media and phones have become an addiction.2) outside people have access to you all the time.3) cyberstalking4) cyberbullying5) catphishing6) viruses7) identity theft8) credit card fraud9) hacking10) money schemes
Answers: 1
You know the right answer?
Learning Objectives:• understand when to use the differentprint statements• create a variable and as...
Questions
question
History, 23.07.2019 00:30
Questions on the website: 13722363