Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

QUESTION 3 - Syntax Errors Refer to the following programs. 3 . 1 The program below contains syntax errors. Correct all errors and provide the

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:
(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}

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

Step: 3

blur-text-image

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

Database Concepts

Authors: David M Kroenke, David J Auer

6th Edition

0132742926, 978-0132742924

More Books

Students also viewed these Databases questions