1- The following code displays ____. double temperature = 50; if (temperature >= 100) System.out.println("too hot"); else if (temperature <= 40) System.out.println("too cold"); else System.out.println("just right"); just right too hot too hot too cold just right too cold
Q: Last mon th Joe purchased 100 shares of stock for $45 .50 per sha re and paid hisstock broker a…
A: #include <iostream>#include <iomanip> using namespace std; int main(){ int…
Q: What will happen if you use JOptionPane.showMessageDialog statement in your program? Select one: O…
A: Answer: Answer-1: The correct option is (e): The program will display a message dialog box…
Q: The variable for level should be of int type. The bonus attack speed % should be converted to…
A: We need to create a Program that computes the current attack speed at a certain level. We need to…
Q: handler: This method retrieves whatever the user has typed into the upper entry, converts it into an…
A: import tkinter as tkfrom tkinter import messageboxdef getAge(years): if years <= 0:…
Q: Using decision structures, Create an application that prompts the user for the day's temperature and…
A: Since the Programming language is not mentioned in the question, we will answer this question in…
Q: Write a statement that produces a random number between 1 and 100 and stores it in the variable…
A: import random luckyNumber = random.randint(1,100)
Q: This program displays a message box including the name of day when th user input it's number. (For…
A: F) 1 - x = CInt(Text1.Test) 2 - Select Case x 3 - Case 7
Q: 2. Create a program that computes and displays a game character's attack speed at a certain level.…
A: Given : To write a program to print the character current attack speed using the above formula. The…
Q: Task4: Write a program that prompts the user to enter a number within the range of 1 through 10. By…
A: In this program we have to write a Linux based program which we can execute using Linux editor Bash…
Q: Correct the following code. Keep the first line of code (double* getValue () {) double getValue() {…
A: “Since you have asked multiple question, we will solve the first question for you. If youwant any…
Q: A Hotel Resérvation Program Write a program that allows the user to reserve a room in a hotel and…
A: Given: To write a Java program for hotel reservations.
Q: 2) Write pseudocode that performs the following: Ask a user to enter a number. If the number is…
A: Declare Number as integer Accept Number from user if number >=0 and number <=10 then print…
Q: Grade Point Average- GPA calculator: Write a program that asks the user to enter his letter grade in…
A: //Program to calculate GPA
Q: the assignment operator is used to store results of a statement into a memory location by an…
A: Given :- the assignment operator is used to store results of a statement into a memory location by…
Q: (Guess the Number Game) Write a program that plays “guess the number” as follows: Your program…
A: A TextBox should be used to input the Number to TextBox1 input the guess. to TextBox2…
Q: Each cout statement has a syntax error. Type the first cout statement, and press Run to observe the…
A: Answer Code in C++ #include <iostream> using namespace std; int main() { int songNum;…
Q: A customer want to buy five items. He has only 75.0 OMR with him. The price of the products are…
A: Solution: We will keep a counter i for the while loop to traverse the array. We will keep a check…
Q: A customer want to buy five items. He has only 75.0 OMR with him. The price of the products are…
A: No.of items = 6 Total_Cost = 0 items = 0 Total_OMR = 75 while items !=No.of Items Add…
Q: The else statement will always be executed when the conditional expression is evaluated false. True…
A: Answer: True True True
Q: what will be displayed when you run the code ? a=0;while a<10; value = %2.2f',a) a=a+3;…
A: The while loop evaluates an expression, and repeats the execution of a group of statements in a loop…
Q: A bag of cookies holds 40 cookies. The calorie information on the bag claims that there are 10…
A: Code: import java.util.Scanner;public class CookieCalorieCounter{ public static void main(String[]…
Q: Trainers at Tom's Athletic Club are encouraged to enroll new members. Write an application that…
A: Step 1 Algorithm Step 1 : Begin Step 2 : Declare an array of strings with size 25 and an array of…
Q: Write an if-else statement that displays 'Speed is normal' if the speed variable is within the…
A: if (speed >= 24 & speed <= 56) then print "Speed is normal" else print "Speed is…
Q: This code needs to be written in C#: If the user guesses the number in 3rd try you will assign:…
A: C# Programming Language : C# is a broadly useful, multi-worldview programming language enveloping…
Q: A mail-order house sells five products whose retail prices are as follows: Product 1, $2.98; product…
A: Programming language is missing in the question. So we will answer this program in C++ language. If…
Q: Scientists measure an object’s mass in kilograms and its weight in Newtons. If you know the amount…
A: Program approach: To create this mass weight application we will use java. We will use java swing…
Q: The Kicking Coffee Café $3.50 E- Espresso $4.15 $1.00 $2.75 L-Latte R-Regular 1- Iced program will…
A: I'm writing C code for following question:
Q: Complete the flowchart & then write pseudo-code while taking manual attendance in a class
A:
Q: A Paint Company has asked you to write an application that calculates the quantity and price of…
A: Required: C++ program to calculate the quantity and price of Paint required to a paint for…
Q: Using a conditional expression, write a statement that increments numUsers if updateDirection is 1,…
A: To create a conditional expression, by adding some code statements to the given program code. So,…
Q: QUESTION 8 Kebabo Internet Services offers customers with 600 weekday minutes for a flat rate of…
A: ANSWER:-
Q: Write a try-catch statement for an application that calculates the sum of two whole numbers and…
A: Consider “value1TextBox”, “value2TextBox” as two text boxes which are used to read two whole numbers…
Q: Complete the following if-else statement that assigns true to a boolean variable fever if the double…
A: 1) Syntax of if-else statement in Java is if (condition) { // block of code to be executed…
Q: 6. Prompt user to enter an integer number from console. Adjust this number if it is not in the…
A: Below is the complete solution with explanation for the given question in detail.
Q: With the statement, int option=3; switch(option){ case 1: printf("1"); break%3; case 2: printf("2");…
A: Here have to determine about the switch statement related programming problem statement.
Q: A Hotel Reservation Program Write a program that allows the user to reserve a room in a hotel and…
A: Source Code: import java.io.*;import java.util.Scanner; public class Reservation{ public static…
Q: Write some simple code that can display a grade in a message box, given the marks through a textbox…
A: ANSWER:-
Q: Create a change-counting game that gets the user to enter the number of coins required to make…
A: Since you are not mentioning the programming language, here we are using C++ to complete the…
Q: Correct the following code. Keep the first line of code (double getValue () () double getValue() {…
A: double* getValue() { double x = 5.1; return &x;} int main(){ cout<<getValue();…
Q: This program displays a message box including the name of day when the user input it's number. (For…
A: 1 - x = Cint(Text1.Text) 2 - Select Case x 3 - Case 7
Q: Write pseudo code and design flowchart that performs the following: 1. Ask a user to enter a number.…
A: START INPUT number IF number >= 0 and number < 10 PRINT "blue" ELSE IF number >= 10 and…
Q: 6- final question Assuming you have implemented a mini calculator. MiniCalculator Result Number 1…
A: The problem is based on the basics of working of inbuilt functions of a programming language.
Q: A one-way if statement performs an action if the specified condition is true. If the condition is…
A: An if statement is followed by its else part which will be executed only if the "IF" condition is…
Q: You need to complete a flowchart that determines whether a temperature is below or above the…
A: Steps Order Start Read Temperature If Temprature > 0o C Yes ( Left Edge ) No (Righ Edge) Above…
Q: Software Sales A software company sells a package that retails for $99. Quantity discounts are given…
A: Since you have not mentioned the programming language, we have provided the code in Python language.
Q: Project 10-3: Interest Calculator Create a program that calculates the interest on a loan. This…
A: Below is the solution, we have used import of regular index to index K and make it 100.
Q: If you execute the following code, what will it display if the user enters 5? 15? 30? −1? int…
A: GIVEN: If you execute the following code, what will it display if the user enters 5? 15? 30? −1? int…
1- The following code displays ____.
double temperature = 50;
if (temperature >= 100)
System.out.println("too hot");
else if (temperature <= 40)
System.out.println("too cold");
else
System.out.println("just right");
just right
too hot
too hot too cold just right
too cold
2- Assume x is 0. What is the output of the following statement?
if (x > 0)
System.out.print("x is greater than 0");
else if (x < 0)
System.out.print("x is less than 0");
else
System.out.print("x equals 0");
x is less than 0
x equals 0
x is greater than 0
None
3- The expression 2 + 4 / (5 - 3) * 2 is evaluated to ____.
1.5
6
8
3
4- if you attempt to add an int value and a double value, the result will be a ____ value.
Is not allowed.
If the first number is int value then the result will be int value and if the first number is double value then the result will be double value.
int
double
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
- Test cases should passed otherwise dislike. Please code should be complete.When an object is falling because of gravity, the following formula can be used to determine the distance the object falls in a specific time period:d =1/2 gt2The variables in the formula are as follows: d is the distance in meters, g is 9.8, and t is the amount of time in seconds that the object has been falling. Create an application that allows the user to enter the amount of time that an object has fallen and then displays the distance that the object fell. The application should have a method named FallingDistance. The FallingDistance method should accept an object’s falling time (in seconds) as an argument. The method should return the distance in meters that the object has fallen during that time interval.Scientists measure an object’s mass in kilograms and its weight in Newtons. If you know the amount of mass of an object, you can calculate its weight, in Newtons, with the following formula: Weight = Mass × 9.8Create an application that lets the user enter an object’s mass and then calculates its weight. If the object weighs more than 1000 Newtons, display a message indicating that it is too heavy. If the object weighs less than 10 Newtons, display a message indicating that it is too light.
- Question: Party budget planning - complex Prompt the user to enter their current budget and the number of people who need to share a meal. You are ordering food from a restaurant that has two menu items: Tacos $4 Empanadas $3 Calculate and print out all the options of meals where the budget is used entirely(where possible) and each person has an equal number of items to eat. They may eat different things, but everyone gets the same number of food items, e.g. 2 tacos or 1 empanada and 1 taco or 2 empanadas. Hints: Here are some things that might help you in your solution. If total items purchased does not equally divide by the number of diners, then abandon that combination. It may help to calculate the max number of empanadas that the budget can buy and also the max number of tacos that the budget could buy. These can be thought of as upper bounds in your loops. In your solution, keep track of items per person Also, keep track of total number of viable solutions, as that might…Question: Party budget planning - complex Prompt the user to enter their current budget and the number of people who need to share a meal. You are ordering food from a restaurant that has two menu items: Tacos $4 Empanadas $3 Calculate and print out all the options of meals where the budget is used entirely(where possible) and each person has an equal number of items to eat. They may eat different things, but everyone gets the same number of food items, e.g. 2 tacos or 1 empanada and 1 taco or 2 empanadas. Hints: Here are some things that might help you in your solution. If total items purchased does not equally divide by the number of diners, then abandon that combination. It may help to calculate the max number of empanadas that the budget can buy and also the max number of tacos that the budget could buy. These can be thought of as upper bounds in your loops. In your solution, keep track of items per person Also, keep track of total number of viable solutions, as that might…Text-based adventure game: Pretend you are creating a text-based adventure game. At different points in the game, you want the user to select to fight, run, or hide from certain enemies. Modify the application below (week3.py) so that the selection variable is sent as an argument into the choice() function. The user should enter 1 to fight, 2 to run, or 3 to hide in the main(). The choice() function should print one of the three options. You will need to add an if statement in the choice() function to make the correct selection.
- Magic Dates The date June 10, 1960, is special because when it is written in the following format, the month times the day equals the year: 6/10/60 Create an application that lets the user enter a month (in numeric form), a day, and a two-digit year. The program should then determine whether the month times the day equals the year. If so, it should display a message saying the date is magic. Otherwise, it should display a message saying the date is not magic.Book Club PointsSerendipity Booksellers has a book club that awards points to its customers based onthe number of books purchased each month. The points are awarded as follows:• If a customer purchases 0 books, he or she earns 0 points.• If a customer purchases 1 book, he or she earns 5 points.• If a customer purchases 2 books, he or she earns 15 points.• If a customer purchases 3 books, he or she earns 30 points.• If a customer purchases 4 or more books, he or she earns 60 points.Write a program that asks the user to enter the number of books that he or she haspurchased this month and then displays the number of points awarded.This code needs to be written in C#: If the user guesses the number in 3rd try you will assign:Points = (10 – 3)^2/100 = 7 ^ 2 = 49 points.When the user presses the ‘Start Game’ button, the game will start. User will enter a number in the largetextbox and press Submit. If number is correct display the Messagebox, else continue with game. Also tellthe user if the number entered was higher or lower than actual number.The problem flow will be as follows:1. Player enters name and number of chances2. Player presses Start game3. Computer generates a secret random number4. Player enters choice5. Program checks if number matches guesses number. If number matches jump to step #106. Program updates message whether the guessed number is more or less than actual7. Program reduces available chances by 1 and display messages on changes8. If chances become 0 stop game and tell use Game has ended, and she will have to press ‘Start Game’again. Same message should be spoken by the program using text to…
- An employee’s current pay rate appears in the txtCurrentRate control. Write an assignment statement that increases the current pay rate by 10 and then assigns the result to the lblNewRate control.Random Number Guessing Game Create an application that generates a random number in the range of 1 through 100 and asks the user to guess what the number is. If the user’s guess is higher than the random number, the program should display “Too high, try again.” If the user’s guess is lower than the random number, the program should display “Too low, try again.” If the user guesses the number, the application should congratulate the user and then generate a new random number so the game can start over. Optional Enhancement: Enhance the game so it keeps count of the number of guesses that the user makes. When the user correctly guesses the random number, the program should display the number of guesses.Falling Distance When an object is falling because of gravity, the following formula can be used to determine the distance the object falls in a specific time period: d =1/2gt2 The variables in the formula are as follows: d is the distance in meters, g is 9.8, and t is the amount of time in seconds that the object has been falling. Create an application that allows the user to enter the amount of time that an object has fallen and then displays the distance that the object fell. The application should have a method named FallingDistance. The FallingDistance method should accept an object’s falling time (in seconds) as an argument. The method should return the distance in meters that the object has fallen during that time interval.