Assgn1: Learning java integer variable, String and how to display the program output to output console...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Assgn1: Learning java integer variable, String and how to display the program output to output console 1) Let's modify the Module0 File Edit View Build Project Settings Tools Window Help XST public class Tast_compilec /21: edasgi first Juni Recl Spri assi assi assi assi assi DD+H&U +P public static void main(String 11 orgal System.out.println("o inatalled JIN AND IS V INFO: What is String & int variables? String is a sequence of characters started with " and ended with ". Example: "You installed JDK & jGrasp IDE correctly!" int is a data type that stores an integer number on computer memory at run time. Example int x=20; Mixing String and variables by using operator +: In order to display to output mixing String and variables by using + operator A) On jGrasp IDE click on File/New/Java, Copy an past or type in the following code public class Label_01 //It is case sensitive { public static void main(String[] args) { int x =20; System.out.println("You installed JDK & jGrasp IDE correctly!" + x); B) Click on jgrasp IDE file menu File/Save and save program name Lab01_01 C) Compile, be sure you do not get compilation error, if you have the above program, you should not get compilation error! Run your program D)- What is the output of the above program? Answer: 2) What is the output of the following program, after compile/run. public class Label_02 //It is case sensitive { public static void main(String[] args) { System.out.println("Programming is great fun!"); System.out.println("Programming is great fun!"); 2)- What is the output of the above program? Answer ?? ?? ?? 3)- After watching videos clip and reading your book and understanding String, integer, variable and identifier, and other program component of programming so far. What is run-time output of following problem. Write the following program compiler/run to what is the value 3 The variable x starts with the value 0. The variable y starts with the value 5. Add I to x. Add I to y Add x and y, and store the result in y. Display the vaue in y on the screen. public class Lab01_03 ? public static voied main(String[] args) int x=0; int y-5; y=y+1; System.out.println("the value y is "y): What is the value of y: What is program name of the above program? Answer: 4 The variable a starts with the value 10. public class Lab01_04 t The variable b starts with the value 2. The variable c starts with the value 4. Store the value of a times b in a. Store the value of b time's c in c. Add a and c, and store the result in b. Display the vaue in b on the screen. public static voied main(String[] args) ( int a-0; int b=2 int c-4; a-a*b; c=b*c: b=a+c; System.out.println("the value b is "+b); On the above program, what is the output of the above program, after compile/run Answer: What is program name of the above program? Answer:__ After you typed, compile and run the Lab01-01 to Lab01_04, take the screenshot of each run time output and submit your work for grading ?? Assgn1: Learning java integer variable, String and how to display the program output to output console 1) Let's modify the Module0 File Edit View Build Project Settings Tools Window Help XST public class Tast_compilec /21: edasgi first Juni Recl Spri assi assi assi assi assi DD+H&U +P public static void main(String 11 orgal System.out.println("o inatalled JIN AND IS V INFO: What is String & int variables? String is a sequence of characters started with " and ended with ". Example: "You installed JDK & jGrasp IDE correctly!" int is a data type that stores an integer number on computer memory at run time. Example int x=20; Mixing String and variables by using operator +: In order to display to output mixing String and variables by using + operator A) On jGrasp IDE click on File/New/Java, Copy an past or type in the following code public class Label_01 //It is case sensitive { public static void main(String[] args) { int x =20; System.out.println("You installed JDK & jGrasp IDE correctly!" + x); B) Click on jgrasp IDE file menu File/Save and save program name Lab01_01 C) Compile, be sure you do not get compilation error, if you have the above program, you should not get compilation error! Run your program D)- What is the output of the above program? Answer: 2) What is the output of the following program, after compile/run. public class Label_02 //It is case sensitive { public static void main(String[] args) { System.out.println("Programming is great fun!"); System.out.println("Programming is great fun!"); 2)- What is the output of the above program? Answer ?? ?? ?? 3)- After watching videos clip and reading your book and understanding String, integer, variable and identifier, and other program component of programming so far. What is run-time output of following problem. Write the following program compiler/run to what is the value 3 The variable x starts with the value 0. The variable y starts with the value 5. Add I to x. Add I to y Add x and y, and store the result in y. Display the vaue in y on the screen. public class Lab01_03 ? public static voied main(String[] args) int x=0; int y-5; y=y+1; System.out.println("the value y is "y): What is the value of y: What is program name of the above program? Answer: 4 The variable a starts with the value 10. public class Lab01_04 t The variable b starts with the value 2. The variable c starts with the value 4. Store the value of a times b in a. Store the value of b time's c in c. Add a and c, and store the result in b. Display the vaue in b on the screen. public static voied main(String[] args) ( int a-0; int b=2 int c-4; a-a*b; c=b*c: b=a+c; System.out.println("the value b is "+b); On the above program, what is the output of the above program, after compile/run Answer: What is program name of the above program? Answer:__ After you typed, compile and run the Lab01-01 to Lab01_04, take the screenshot of each run time output and submit your work for grading ??
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
QUIZ... Let D be a poset and let f : D D be a monotone function. (i) Give the definition of the least pre-fixed point, fix (f), of f. Show that fix (f) is a fixed point of f. [5 marks] (ii) Show that...
-
answer the question clearly You are building a flight-control system for which a convincing safety case must be made. Would you assign the tasks of safety requirements engineering, test case...
-
A projectile launcher fires a marble of mass 2 5 grams perfectly vertical. The launcher uses a spring with a constant, k , of 6 0 . 0 Newtons / meter . If the spring is depressed 1 5 centimeters and...
-
The following transacstions of Signature Music Company occurred during 2016 and 2017: 2016 Mar 3 Purchased a piano (inventory) for $70,000, signing a six-month, 10% note payable. May 31 Borrowed...
-
Troy Engines, Limited, manufactures a variety of engines for use in heavy equipment. The company has always produced all of the necessary parts for its engines, including all of the carburetors. An...
-
What are the page limitations for memorandum of points and authorities?
-
Deep Impact Mission in July 2005, NASA's "Deep Impact" mission crashed a 372-kg probe directly onto 1he surface of the comet Tempell, hitting the surface at 37,000 km/h. The original speed of the...
-
The Megan Companies (MC) IPO offer price was $15 (per share). When MC shares began trading in the public market, the price was $13.50. The MC IPO was: a.) Underpriced by 10% b.) Overpriced by 11.11%...
-
Bruce also requires a calculation of taxable income for the most recent year ended December 31, 2019. The calculation should be prepared in Excel. He has also requested that you prepare the year-end...
-
You have been asked to evaluate the proposed acquisition of a new Machine for your company. The machine's basic price is $150,000. Assume that the machine can be depreciated using straight line over...
-
A hacker's 'dictionary' contains 900,000 passwords which have been sold to her on the dark web. She also has gained knowledge of 300,000 usernames for a particular target site. She is going to try...
-
A firm has a marginal cost curve given by MC = 10 + 4Q (where Q is measured in thousands of units) and faces an exogenously given price P0. If P0 = 20 and the firm produces a positive quantity that...
-
Consider a permanent decrease in labor supply (a shift of the labor supply curve up and to the left).Statehow each of the variables will change (if at all) once the economy moves to its new long run...
-
(a) (b) (c) Build a binary search tree for the quota "If you think you are too small to make a difference, try sleeping with a mosquito" using alphabetical order. (7 marks) Use the Huffman coding to...
-
ok t ht Imperial Jewelers manufactures and sells a gold bracelet for $406.00. The company's accounting system says that the unit product cost for this bracelet is $260.00 as shown below: Direct...
-
Strikes cost SA 1.6 million work days in six months - up 3 000% from 2021 South Africas workdays lost due to strike action rose more than 30-fold in the six months through June compared with the same...
-
Why is inventory management important for merchandising and manufacturing firms and what are the main tradeoffs for firms in managing their inventory?
-
To run the query, what can be done to identify/select the DepartmentID of interest? A query is needed to show all students enrolled in any course for a specific department.
-
What must be changed in the physical data model to store information with customer ratings for items purchased from each supplier?
-
When creating a table, when is the Allow null option selected for a column?
-
Discuss the approach you would take to building a system for playing Scrabble or another word game of the sort. What limitations does your system have? How likely do you think it is that your system...
-
Discuss the current state of the art of game-playing computer systems in relation to the following games: chess, checkers, Go, bridge, Othello, tic-tac-toe. What advances are likely in the near...
-
Show the steps that would be taken in running the Minimax algorithm on the game tree in Figure 6.7. Now run through the same tree using alpha-beta pruning. How do the two compare? data from figure...
Study smarter with the SolutionInn App