Tag: Conditionals

September 23, 2023

Java Conditionals Exercises

Write a condition that checks if the item is affordable. class Main { public static void main(String[] args) { double itemPrice = 1900.25; double wallet = 2100.50; if “”{ System.out.println(“The item is affordable!”); } } } fileSizeLimitation){ System.out.println(“File size exceeds the maximum allowable limit.”); System.out.println(“Please choose a smaller file.”); } } } Submit Check if […]

September 1, 2023

Python Conditionals Exercises

What will be the value of the letter_grade variable? exam_score = 85 program_of_study = ‘Electrical Engineering’ if program_of_study == ‘Computer Science’: if exam_score >= 90: letter_grade = ‘A’ elif exam_score >= 80: letter_grade = ‘B’ elif exam_score >= 70: letter_grade = ‘C’ elif exam_score >= 60: letter_grade = ‘D’ else: letter_grade = ‘F’ elif program_of_study […]

September 1, 2023

Python Conditionals Exercises

What will be the value of the shipping_cost variable? destination_zone = “Zone C” if destination_zone == “Zone A”: shipping_cost = 10.0 elif destination_zone == “Zone B”: shipping_cost = 15.0 elif destination_zone == “Zone C”: shipping_cost = 20.0 else: shipping_cost = 25.0 print(“The shipping cost to”, destination_zone, “is:”, shipping_cost) 20.0 25.0 Submit What will be the […]

September 1, 2023

Python Conditionals Exercises

Write a condition that checks if the item is affordable. item_price = 1900.25 wallet = 2100.50 if ”: print(‘The item is affordable!’) wallet item_price max_file_size: print(‘File size exceeds the maximum allowable limit.’) print(‘Please choose a smaller file.’) Submit Check if the file size exceeds the maximum allowable size for uploading. Otherwise upload the file. file_size […]