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, 22.06.2019 14:00
What are procedures that keep a data base current
Answers: 1
question
Computers and Technology, 22.06.2019 22:40
Least square fit to polynomial write a function leastsquarefit3pol that solves a linear system of equations to find a least squares fit of a third order polynomial to an experimental data set given as two row arrays. the function leastsquarefit3pol must explicitly solve a set of linear equations and cannot use polyfit. there should be no restriction on the size of the problem that can be solved.
Answers: 1
question
Computers and Technology, 25.06.2019 08:10
Why should the technician watch for signs of contamination in the oil when recovering refrigerant from a system
Answers: 3
question
Computers and Technology, 25.06.2019 14:00
Suppose we are performing a binary search on a sorted array called numbers initialized as follows: // index 0 1 2 3 4 5 6 7 8 9 10 11 12 13 int[] numbers = {-2, 0, 1, 7, 9, 16, 19, 28, 31, 40, 52, 68, 85, 99}; // search for the value 5 int index = binarysearch(numbers, 5); write the indexes of the elements that would be examined by the binary search (the mid values in our algorithm's code) and write the value that would be returned from the search. assume that we are using the binary search algorithm shown in lecture and section.
Answers: 3
You know the right answer?
Learning Objectives:• understand when to use the differentprint statements• create a variable and as...
Questions
Questions on the website: 13722363