Cash-back offer from May 2nd to 7th, 2024: Get a flat 10% cash-back credited to your account for a minimum transaction of $50.Post Your Questions Today!

Question DetailsNormal
$ 16.00

IT 401 Assignment 2 | Complete Solution

Question posted by
Online Tutor Profile
request

Question One
Identify and correct the error(s) in each of the following:  
1. double X = 12.5;
    int Y =X+4;

2. if (x = 1)
       y++;
  else if (x = 2)
     y = y + 2;
3. final double QUARTER_VALUE = 0.25;
      QUARTER_VALUE = 0.30;


Question Two
2.1Given the code:
 
what is the output in each of the following cases?
1. x=5 , y=2 , z=2   
2. x=2 , y=0 , z=0  
3. x=-1 , y=0 , z=0  
2.2 what is the output of the following code :
 
Question Three
Write complete Java programs, provide a screen snapshot
showing your program in execution to receive full credit.

Write a program that reads a Celsius degree in double from the console, then converts it to Fahrenheit and displays the result.

The formula for the conversion is as follows:

πΉπ‘Žβ„Žπ‘Ÿπ‘’π‘›β„Žπ‘’π‘–π‘‘=(9÷5 )×𝐢𝑒𝑙𝑠𝑖𝑒𝑠+ 32


Typical run of the program:

Enter a Celsius degree: 35.5
35.5 degree Celsius is about 67.5 Fahrenheit.

    
Question Four
Write the following mathematical expressions in Java.  

 

Question Five
Consider the code:

String s;
Scanner in = new Scanner(System.in);
System.out.print("Enter a word: ");
s = in.next();

5.1 write one statement to  test if the user enters the string "Hello".

 

5.2 assume s = "I love KSA " ;
What is the output the following code ?

String S1= s.substring(4,10);
System.out.println(S1);

Available Answer
$ 16.00

[Solved] IT 401 Assignment 2 | Complete Solution

  • This solution is not purchased yet.
  • Submitted On 22 Dec, 2017 07:53:40
Answer posted by
Online Tutor Profile
solution
1. double X = 12.5; int Y =X+4; use of double in int calculation correction double Y=X+4...
Buy now to view the complete solution
Other Similar Questions
User Profile
Exper...

IT 401 Assignment 3 | Complete Solution

(iii) How many times does the following Java code display "Java Program" output? for (int i = 0; i < 10; i++); { System.out.println(" Java Program "); } Answer: β€œJava Program” will be printed only once becau...
User Profile
Exper...

IT 401 Assignment 2 | Complete Solution

1. double X = 12.5; int Y =X+4; use of double in int calculation correction double Y=X+4; 2. if (x = 1) y++; else if (x = 2) y = y + 2; Use of assignment statement in loop test Correction if(x==1) else i...
User Profile
Exper...

IT 401 Assignment 4 | Complete Solution

To get the number of columns in the third row, You first go to the third row, index 2 (counts[2]). The length method is used to retrieve the number. Therefore, counts[2].length System.out.println(counts[2].length); B The int ...

The benefits of buying study notes from CourseMerits

homeworkhelptime
Assurance Of Timely Delivery
We value your patience, and to ensure you always receive your homework help within the promised time, our dedicated team of tutors begins their work as soon as the request arrives.
tutoring
Best Price In The Market
All the services that are available on our page cost only a nominal amount of money. In fact, the prices are lower than the industry standards. You can always expect value for money from us.
tutorsupport
Uninterrupted 24/7 Support
Our customer support wing remains online 24x7 to provide you seamless assistance. Also, when you post a query or a request here, you can expect an immediate response from our side.
closebutton

$ 629.35