int main() { if (X>20&&X<90) { if (X>50) { printf("Who? "); } else { printf("What? "); } else { printf("Where"); } What is the ouput of the program when in complete program if x=60?
Q: Language: JAVA Leap-Year Write a program to find if a year is a leap year or not. We generally…
A: import java.io.*;import java.util.*;class LeapYear { public static void main(String args[]) throws…
Q: PYTHON PROGRAMMING A retail company assigns a $5000 store bonus if monthly sales are more than…
A: Introduction PYTHON PROGRAMMING A retail company assigns a $5000 store bonus if monthly sales are…
Q: public void setQuantity(int quantity}{ minimum quantity is 10 if invalid set it to 10 if(quantity <…
A: Given: Fill in the blanks.
Q: (2) Reverse a number using while Loop Write a java code that prompts the user to input a…
A: Based on our rule, we should answer only one question when multiple questions are posted. Please,…
Q: PROGRAM SUBPROGRAM_1 IMPLICIT NONE REAL :: F, X, A, B, C INTEGER ::I, J, K F(X) = X**2 + 2 A = 3. B…
A: A ForTran program consists of a number of statements each written in a separate line and represents…
Q: Reham's little brother has a geographical compass which has 'S', 'N', 'W' and 'E' marked on it. Her…
A: Step 1: Prompt and accept the alphabet. Step 2: Use if-else if-else construct to compare the…
Q: Consider yourself driving with 60 miles/hour in a city that has only grid like streets, and your GPS…
A: Java Code: // Include the necessary header files. import java.io.*; import java.util.Random; import…
Q: Write a program to calculate electricity bill charged to a consumer. Ask him to enter the units…
A: Please find the answer below :
Q: In the sport of diving, seven judges award a score between 0 and 10, where each score may be a…
A: Diving scores use a range from one to 10, in ½-point increments. The score of each dive is…
Q: Flow chart for a program called TimeConvertor.java that converts times expressed in 24-hour clock to…
A: Flowchart for time convertor from 24 hour to 12 hour Source code for time converter from 24 hours…
Q: Practical quiz 2 Write a Java program that will ask the user for the number of rooms (including…
A: import java.text.DecimalFormat;import java.util.Scanner; public class RoomChargeMain { public…
Q: Write a program that takes the income of an employee and calculates the corresponding net income and…
A: Since no coding language is mentioned, I have picked Python. Now let's move on to the code. I have…
Q: Enter the number of days: Day Cents $ 0.01 2 $ 0.02 3 $ 0.04 4 $ 0.08 $ 0.16 $ 0.32 $ 0.64 $ 1.28 $…
A: Find Your Code Below
Q: Note: Help me debug and complete code The program should do the following: Show the customer the…
A: Program: Programs contain a set of lines of code, where the instructions are given through these…
Q: Project Name: Chpt2_Project Class Name: Chpt2_Project Write a Java program that calculates how fast…
A: Required java code with sample output given below :
Q: Design a program that asks the user for a series of names (in no particular order). After the final…
A: Program Plan: Create an empty list to store the names. Start the loop till 1 is pressed. Input name…
Q: Direction: Create a simple Java Program that will output the grades of 1 student in different…
A: Find Your Answer Below
Q: Questions #2: Assets Depreciation Program Businesses fixed assets, such as buildings, equipment,…
A: Algorithm: Start Read price, salvage and years used Calculate d=(p-s)/y Set…
Q: An Auto Insurance Program Example - Write a program to determine the cost of an automobile insurance…
A: Program approach: Import Scanner package for input. Create a class. Create the main method. Create…
Q: If you are flying with an economy ticket, there is a possibility that you may get upgraded to…
A: Decision table is a method of describing the logical relationship as a visual representation ( in…
Q: ructions Tutoring Problem program.py > If it is not currently raining, your method of transport…
A: I give the code in Python along with code and output screenshots
Q: Sales Commissions. You were hired in a store to implement a program that computes sales commission…
A: The required python program has been coded using if-else statements and has been provided in the…
Q: Complete the given program so that will ask the user to enter 5 fruit items given the name, price,…
A: Swift code to solve the given problem
Q: beginers given real numbers a,b,c, a≠0 Solve the equation 2x+bx+c=o
A: Given: Solve the equation ax^2+bx+c=o The solution for ax^2+bx+c will be x=(-b±b2-4ac )(2*a) So we…
Q: Fill in the blank so that a program is constructed where the user enters a sentence, and it finds…
A: The character in array is to be compared with ASCII value to find whether it is digit or character…
Q: Create a program that has the following methods and corresponding usage. AreaCircle - compute…
A: Introduction: In this question, we are asked to write a C# programming to create the two methods :…
Q: e a simple payroll program that will display employee’s information. Refer to the UML Class Diagram…
A: Q: Code the given problem
Q: The Game of Nim Problem Description: Two players alternately take marbles from a pile. In each move,…
A: Program Requirements as per question: The program must define and use the following methods, int…
Q: Linear Program Exercise You need to write a program that solves the following the real-world…
A: We need to solve the given optimization problem using scipy in Python.
Q: Complete the given program so that will ask the user to enter 5 fruit items given the name, price,…
A: #include <iostream> #include <string> using namespace std; struct fruitData {…
Q: Using Java programming language write a program to manage a hotel with 24 rooms; 10 rooms are…
A: It is defined as
Q: An Auto Insurance Program Example - Write a program to determine the cost of an automobile insurance…
A: Program Explanation – Import the essential java libraries. Declare the class named as Main.…
Q: You have just started a sales job in a department store. Your pay consists of a base salary plus a…
A: PROGRAM CODE: import java.util.*;public class Main { public static void main(String[] args) { //…
Q: Write a loan calculator program that computes both monthly and total payments for a given loan…
A: As no language was mentioned, So, solving with C++. #include<iostream> using namespace std;…
Q: program that reads an integer sum in dollars and displays how many dollars bills of $100, $50, $20,…
A: program that reads an integer sum in dollars and displays how many dollars bills of $100, $50,…
Q: (Financial application: find the profit-per-item) You have just started a new stationary shop. Your…
A: Note: As programming language is not mentioned. So, used C++ language to complete the task. Program:…
Q: Write a program on if, if else, if else if in Java language.
A: Java program to use the if if else if else if staments. if, if else, and if else if are the…
Q: B is K ∴ No K is J Convert the following argument into symbolic form and then determine whether it…
A: Lets see the solution.
Q: The Mach number is a critical quantity in aerodynamics. It is the ratio of the speed of an object…
A: MATLAB code given below
Q: Equal numbers: Given three integers, determine how many of them are equal to each other. The program…
A: Please find the answer below :
Q: Write a program that quizzes the user on the names of the capital cities for all the states in the…
A: Solution:-- 1)The given problem has required for the solution which is to be provided for the quiz…
Q: A bug collector collects bugs every day for 7 days. Write a program that keeps a running total of…
A: A bug collector collects bugs every day for 7 days. Write a program that keeps a running total of…
Q: Write a program that will ask for a sentence and letters to cross out. It should then print the…
A: The question is to write C++ code for the given problem.
Q: Suppose that the tuition for a university is $10,000 this year and increases 5% every year. Write a…
A: In the computer programming, the concepts of the language that can be organized and managed as the…
Q: Classification Based on Range (with C++) Write a program that takes the income of an employee and…
A: #include <iostream>using namespace std;int main() { int income,net_income,tax;…
Q: C++ Program point* nearer(point* p1, point* p2) This method will return whichever point, either p1…
A: Calculate distances from this point to p1 and p2 Store the distance values in 2 variables Compare…
Q: Parse String that look like below: cookies>mile>fudge:cake:ice cream Display the food item in…
A: Algorithm: 1.Import util package for Scanner class 2.create a class called Main 3.Take User_input…
Q: Problem: A company wants a program that will calculate the weekly paycheck for an employee based on…
A: According to Question we need to provide : 1. Pseudo-code2. Flowchart3. Python Code
Q: A salesperson gets a yearly bonus based on a commission from collections of sales and review from…
A: Declare a structure of Sales Executive record called SalesExecutive typedef struct Sales { char…
int main()
{
if (X>20&&X<90)
{
if (X>50)
{ printf("Who? "); }
else
{ printf("What? "); }
else
{ printf("Where"); }
What is the ouput of the
Step by step
Solved in 3 steps with 1 images
- JAVA Programming Problem 2 - Diving In the sport of diving, seven judges award a score between 0 and 10, where each score may be a floating-point value. The highest and lowest scores are thrown out and the remaining scores are added together. The sum is then multiplied by the degree of difficulty for that dive. The degree of difficulty ranges from 1.2 to 3.8 points. The total is then multiplied by 0.6 to determine the diver’s score. Write a computer program that will ultimately determine the diver’s score. This program must include the following methods: A method name inputValidScore that inputs one valid score for one judge for one diver. This method will return the valid score. A method named inputAllScores that creates an array to store the scores for all judges for the diver. This method will fill the array with a valid score from each judge. This method does not take input arguments, but it does return the array of scores. A method named inputValidDegreeOfDifficulty that inputs a…Java Lab 5 Problem Statement Write a program that quizzes the user on the names of the capital cities for all the states in the United States. Each state is presented to the user, and they must enter the name of the capital. The program then either tells the user they're correct or tells them the correct answer. The user's answer should not be case-sensitive. At the end, the program tells the user the total number they got correct. Here's an example: What is the capital of Alabama? MontogomeryThe correct answer is Montgomery.What is the capital of Alaska? juneauThat is the correct answer!...You got 32 out of 50 correct! The state capitals will be stored in a 2D String array of size 2 x 50, with the first column the name of the state and the second the name of the capital city, for all 50 states. To create the state capitals array, follow these instructions: Copy the String from the attached file into your program (found below these instructions). The String is a pipe delimited…Write program in C++ Language The other solutions on chegg were incorrect! Please read carefully! Write a program that defines and tests a class called COP3014. The class resembles aclassroom. It has the following grading scheme:3 quizzes 20 points each 20%Mid term 100 points 30%Final 100 points 50%Based on the total grade of any student for the course, the letter grade of each student can becomputed as follows:Any grade of 90 or more is an A, any grade of 80 or more (but less than 90) is a B, any grade of70 or more (but less than 80) is a C, any grade of 60 or more (but less than 70) is a D, and anygrade below 60 is an F.This class needs to have some member variables. The first name, last name, the Z-number, thegrades, the total grade and final letter grade are all considered to be private member variablesof this class.The class should also have the following public member functions/procedural attributes that canbring the objects (students of the class) to life and give them some…
- In C++ QUESTION 14 class rectangleType { public: void setLengthWidth(double x, double y); //Sets the length = x; width = y; void print() const; //Output length and width double area(); //Calculate and return the area of the rectangle (length*width) double perimeter(); //Calculate and return the perimeter (length of outside boundary of the rectangle) private: double length; double width; }; Write the function definition for the function perimeterIn Java Exercises: Polymorphism Problem 1.Vehicles Write a program that models 2 vehicles ( Car and Truck ) and will be able to simulate driving and refueling them. Car and truck both have fuel quantity , fuel consumption in liters per km and can be driven given distance and refueled with given liters. But in the summer both vehicles use air conditioner and their fuel consumption per km is increased by 0.9 liters for the car and with 1.6 liters for the truck. Also the truck has a tiny hole in his tank and when it gets refueled it gets only 95% of given fuel. The car has no problems when refueling and adds all given fuel to its tank. If vehicle cannot travel given distance its fuel does not change. Input On the first line - information about the car in format {Car {fuel quantity} {liters per km}} On the second line – info about the truck in format {Truck {fuel quantity} {liters per km}} On third line - number of commands N that will be given on the next N lines On the next N…Parking Charges Program in java Write a program that works out the amount a person has to pay for parking in a car park in a tourist town. If they say they are disabled, they are told it is free. Otherwise they enter the number of hours as a whole number (1-8) that they wish to park as well as whether they have an “I live locally” badge or are an old age pensioner both of which leads to a discount. The program tells them the cost to park. The calculation is done in this program as follows. If they are disabled it is free. Otherwise ... Take number of hours they wish to park and give a basic charge: • • • • 1 hour: 3.00 pounds 2-4 hours: 4.00 pounds 5-6 hours: 4.50 pounds 7-8 hours: 5.50 pounds Next modify the resulting charge based on whether they are local or not: • If local: subtract 1 pound If OAP: subtract 2 poundsYour program MUST include methods including ones that - asks for the hours and returns the basic charge. - asks whether they live locally /…
- User Defined Function: Void Function Create a JAVA program that will add, subtract, multiply and divide two numbers. Use user defined function for each operator Any number divided by zero will result to undefined Use int or double data type only for all variables declaredEXPECTED OUTPUT:Java uses a right barace to mark the end of all compound statement what are arguments can you make against that statementLanguage is c++ Assignment 6 C: Minesweeper - Simplified. For many years, computers sold with the Windows operating system would contain a game called M inesweeper. The player would be presented with a grid, where they would have to click an empty part of the map. If they clicked on a hidden mine, the game would be instantly over. However, if they clicked a safe spot, a hint about nearby mines would be displayed and the player would click another spot. The goal would be to flag all the hidden mines without hitting one. (As an aside, many people did not know these rules and just clicked around randomly until they hit a mine)We will be developing a simplified version of this game. You will prompt the user for a grid size and then created a 2D array with equal width and height (C++ students: Check the Appendix for more information on how to do this). You will initialize the 2D char array with each element equallying a ‘?’ symbol. You will then randomly generate one “mine” value per…
- C++ code A simple version of snakes and ladderImplement a game that initially asks how many players will play the game. The game will then ask the name of each player. The game is played as follows:1. The game is played iteratively. In every iteration, every player takes turn to roll a dice. The face value of dice is added to the total score of the player.2. The first player to reach 100 score gets 1st position. The second player to reach 100 score gets 2nd position.3. When a player reaches 100, he no longer remains part of the play. If current score + face value is greater than 100, then the player will retry in the next iteration, i.e., the score must exactly become 100.4. There are ladders at 20 and 60. If a player’s score becomes exactly 20, the score becomes 40. If a player’s score is exactly 60, the score becomes 75. Similarly, there are snakes at 50 and 90. If a player’s score is exactly 50, the score become 40. If a player’s score is exactly 90, the score becomes 79.5. When n-1…In C# Implement the inventory manager class. This class must have methods that do the following: Add a new item to the inventory manager. Remove an item from the inventory manager. Re-stock an item in the inventory manager. Display the items in the inventory manager. Search for an item in the inventory manager by at least two criteria (name, price, quantity, etc.). Test the inventory manager class with a driver program or unit tests. This may be a console application.Create a class “Student” with data members such as roll number, name and branch. Create another class “Exam” for storing marks of three subjects. Derive a new class “Result” from “Student” and “Exam” class with data members such as total and average. Display the values of all the data members. Develop a C++ program to model the above relationships. Include comments for the code. Also, can you include screenshots of the code and the output as well Test cases Private – Input 1000 ABC CSE 90 80 70 Output 240 80 Public – Input 2000 DEF IT 25 30 35 Output 90 30