Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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}QUESTION 3- Syntax Errors
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:
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions