Question: QUESTION 3 - Syntax Errors ( 2 0 Marks ) Refer to the following programs. 3 . 1 The program below contains syntax errors. Correct

QUESTION 3- Syntax Errors (20 Marks)
Refer to the following programs.
3.1 The program below contains syntax errors. Correct all errors and provide the complete correct code for
the below program:
(10 Marks)
1 Import javax.swing.JOptionPane
2 public Class Check_Temp {
3 public static void main (string [] args){
4 int temp
5 string str = JOptionPane.showInputdialog("Enter temperature value: ")
6 temp = Integer.ParseInt(str)
7
8 if ((temp >=25) and (temp <=45)){
9 System.out.Println("The weather is perfect for the beach :) ")
10} else {
11 System.out.Println("The weather is perfect to stay indoors")
12}
13}
14}
3.2 The program below contains errors. Correct all errors and provide the complete correct code for the
below program:
(10 Marks)
1 Public class Q3_2{
2 public Static void Main (String args)
3 For( count =100 count >=0 count--){
4 System.out.println(Count)
5}
6}
7}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!