Objective In this challenge, we’re getting started with conditional statements. Check out the Tutorial tab for learning materials and an instructional video! Task Given an integer, n, perform the following conditional actions: If n is odd, print Weird If n is even and in the inclusive range of 2 to 5, print Not Weird If n is even and in the inclusive range of 6 to 20, print Weird If n is even and greater than 20, print Not Weird Complete the stub code provided in your editor to print whether or not n is weird. Input Format A single line containing a positive integer, n . Constraints 1<= n <= 100 Output Format Print Weird if…
-
-
ObjectiveIn this challenge, you’ll work with arithmetic operators. Check out the Tutorial tab for learning materials and an instructional video! TaskGiven the meal price (base cost of a meal), tip percent (the percentage of the meal price being added as tip), and tax percent (the percentage of the meal price being added as tax) for a meal, find and print the meal’s total cost. Note: Be sure to use precise values for your calculations, or you may end up with an incorrectly rounded result! Input Format There are 3 lines of numeric input:The first line has a double, mealCost(the cost of the meal before tax and tip).The second line has an integer, tipPercent (the percentage of mealCost being…
-
Objective Today, we’re discussing data types. Check out the Tutorial tab for learning materials and an instructional video! Task Complete the code in the editor below. The variables i ,d , and s are already declared and initialized for you. You must: Declare 3 variables: one of type int, one of type double, and one of type String. Read 3 lines of input from stdin (according to the sequence given in the Input Format section below) and initialize your 3 variables. Use the + operator to perform the following operations: Print the sum of i plus your int variable on a new line. Print the sum of d plus your double variable to a scale of…