int main() { if(var1>50) { num = 20.0 } else { if(var1>35) ---- Line 7 { num= 35.0; } else if (var1<80) { num=60.0; } else { num=40.0; } } What should be the outcome of the condition in line 7 in order for the value of num to be equal to 60.0?
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: Help code in Java 21. Compound Interest When a bank account pays compound interest, it pays…
A: Programming Approach: Importing necessary packages. Defining the main class. Create an object of…
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: main.c 10. Lucky Customer by Jay Vince Serato E Run Tests We have a special promo here in our…
A: According to the Question below the solution: Output:
Q: Previously in this chapter you saw the card_dealer.py program that simulates cards being dealtfrom a…
A: Program1 import os import random deck = [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]*4 def…
Q: Java Program (Display the prime factors) Write a program that prompts the user to enter a positive…
A: In the java program, the necessary libraries are included for the Math and Scanner classes. Create a…
Q: (Algebra: solve quadratic equations) The two roots of a quadratic equation ax? + bx + c = 0 can be…
A: For the question we need user to input value for a,b,c. Then we will check value of b^2 - 4ac And…
Q: This is the question: Write an application that displays the factorial for every integer value from…
A: Note: Below is the required java program. Programming Approach: Declaring the main class…
Q: Problem Description: The international standard letter/number mapping found on the telephone keypad…
A: The pseudocode is as follows:Prompt user for a letter in upper caseReceive the input.Convert the…
Q: *3.1 (Algebra: solve quadratic equations) The two roots of a quadratic equation ax? + bæ + c = 0 can…
A: Code: import java.lang.Math;import java.util.Scanner; class Roots{public static void main(String…
Q: A particular talent competition has 5 judges, each of whom awards a score between 0 and 10 to each…
A: Given: To write a program that uses these rules to calculate and display a contestant’s score. A…
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: Assignment Write a program that calculates the revenue of a trip of a train composed of several…
A: Dear Student, As no programming language is mentioned so, I am coding it in c++. I will also provide…
Q: C++ Angle Calculator Write a program that asks the user for an angle, entered in radians. The…
A: C++ Angle Calculator Write a program that asks the user for an angle, entered in radians. The…
Q: int z = 2.2; %3D if(x 3) z = X + y; if(z > -1){ cout <« "z is " + y; } else cout <« "z is + z;
A: int z = 2.2 would result in z = 2 as decimal would be ignored. And instead of + I am taking <<…
Q: Twin primes are a pair of prime numbers that differ by 2. Forexample, 3 and 5 are twin primes, 5 and…
A: Program: //include header file import java.util.Scanner; //definition of main class public class…
Q: This program assigns values to two variables // and performs mathematical operations with them
A: Errors 1. System.out.println("adding " + x + y); The above statement concatenates the value of x and…
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: 10) The assignment statement p = d; is legal even though p is not a Dog.
A: Please see the next step for solution
Q: The Body Mass Index – BMI is a parameter used to measure the health status of an individual. Various…
A: The Answer start from step-2.
Q: A flight company computes the ticket price of a travel depending on the reservation rate and the…
A: The requested Java program code has been provided in the next step using if-else statements.
Q: IN PYTHON PLEASE AND FLOWCHART DRAWING COPUTERIZED PLEASE!! In many businesses across the…
A: Program:- import sysTotalAmount=input("Enter total cost of purchase: ") GivenCash=input("Enter…
Q: using namespace std; eint div_2(int a){ if(a%2==0){ return 1; return -1; } 4} evoid div_6(int b){ }…
A: Program always start frommain function. main function call div_6(12) and it pass 12 to the function.…
Q: So if the new balance is $38.00 then the person must pay the whole $38.00; if the balance is S128…
A: CODE: JAVA PROGRAMMING LANGUAGE import java.util.*;import java.text.*;public class CreditCardBill{…
Q: The Body Mass Index – BMI is a parameter used to measure the health status of an individual. Various…
A: Start Variables name with type string and weight, height as type double Define constructor BMI…
Q: Write a program that works out the amount a person has to pay for parking in a car park in a tourist…
A: The program is to calculate parking charges. If they say they are disabled, they are told it is…
Q: ISSUE NEEDED TO BE SOLVED: I attached the error codes that keep presenting themselves with the code…
A: Below is the explanation:
Q: Code a game of sudoku in C++ where the user needs to guess the missing numbers in the grid. The grid…
A: The code implementation is given in the below steps.
Q: Write method IsEven that uses the remainder operator (%) to determine whether an integer is even.…
A: Program : import java.util.Scanner; public class Main { public static boolean isEven(int z){…
Q: T/F 2) The following method lacks a base case. public int noBaseCase(int x) { if(x > 0) return…
A: Given that, The following method lacks a base case.public int noBaseCase(int x){if(x > 0)return…
Q: Re-type the code and fix any errors. The code should convert non-positive numbers to 1. if (userNum…
A: Hey, since multiple questions posted, we will answer first question according to our policy. If you…
Q: Write an application that plays the game of Fermi. Generate three distinct random digits between 0…
A: def play(nrounds, ndice=2): player_capital = computer_capital = nrounds for i in range(nrounds):…
Q: void func1(int&); void func2(int&, int&); void func3(int, int); eint main(){ int x = 0, y = 0, z =…
A: Introduction of the Program: The C++ program is an example of pass by reference where the reference…
Q: Following code in C using random Name Reg no and highschool name Use switch case in C language to…
A: The program is written in C #include <stdio.h>#include<stdlib.h>int main(){ int…
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: Java Script You go to a jewelry shop and try to find the most expensive piece of jewelry. You write…
A: In this problem, we need to design a javascript program. Input - one map with multiple arguments…
Q: Java Class: Fundraiser You are a fundraising distributor who needs to to pre-sell a limited number…
A: A java program is defined as a class with a main function defined inside the class. The main program…
Q: void functionOne(int number) { if (number < 10) time++; else { for (int i= 0; i< number; i++)…
A: Ans 1: The big oh notation of the first given function is O(n). As per the given function the for…
Q: rint a ticket indicating the person's seat number and whether it’s in the first class or economy…
A: The below program is a code for railway reservation(seat selection) for users. It has features of…
Q: // This program assigns values to two variables // and performs mathematical operations with them…
A: Explanation: In the given code, values are assigned to "3" variables namely "x", "y", and "z". The…
Q: The following program generates an error. Why? public static void printSum(int num1, int num2) {…
A: main is void so, it can not return any value hence, return 0 should not be there. printsum() is…
Q: JAVA CODE Write a program that quizzes the user on the names of the capital cities for all the…
A: Code snippet:
Q: " *", or "/"). The method should throw ar Write a method that computes the value of an arithmetic…
A: PROGRAM: //Header file import java.util.*; //Defining the class public class Arithmetic {…
Q: Re-type the code and fix any errors. The code should convert non-positive numbers to 1. if (userNum…
A: After creating scanner class prompt the message to accept number from user. Store this number into…
Q: Computer Fundamentals and Programming 2 Write a program that determines a student’s grade. The…
A: logic:- read three score. Find avg=(a+b+c)/3 use if else to find out avg category. Display grade.…
Q: O A thrown Error indicates a serious problem that a reasonable application should not try to catch.
A: Error is a subclass of Throwable that indicates serious problems that a reasonable application…
Q: Create a grade calculator that computes for the semestral grade of a course. Students could type…
A: Python Code: # Enter the name, course, Prelim, mid term and finalName = input("Enter Student Name:…
Q: (Simple computation) The formula for computing the discriminant of a quadratic equation ax^2 + bx +…
A: class Exercise01_01Extra { public static void main(String[] args) { // Declaring variables…
int main()
{
if(var1>50)
{
num = 20.0
}
else
{
if(var1>35) ---- Line 7
{
num= 35.0;
}
else if (var1<80)
{
num=60.0;
}
else
{
num=40.0;
}
}
What should be the outcome of the condition in line 7 in order for the value of num to be equal to 60.0?
Step by step
Solved in 3 steps
- 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…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 /…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 perimeter
- In java Develop a function that takes two integers and returns the sum of the values from the first to the second (the two inputs may be in any order). Call the function at least twice with different arguments Develop a void function PrintLineOfChar that accepts a single character and an integer. The function prints a single line of the character repeated the integer number of times. Call the function at least twice with different arguments.IN C# I need to Write a program named InputMethodDemo2 that eliminates the repetitive code in the InputMethod() in the InputMethodDemo program in Figure 8-5. Rewrite the program so the InputMethod() contains only two statements: one = DataEntry("first");two = DataEntry("second"); (Note: The program in Figure 8-5 is provided as starter code.) Figure 8-5:(picture) my errors are Method DataEntry is defined to eliminate repetitive code 0 out of 1 checks passed. Review the results below for more details. ChecksUnit TestIncompleteMethod DataEntry prompts the user to enter an integer and returns the integer. Build StatusBuild FailedBuild OutputCompilation failed: 1 error(s), 0 warningsInputMethodDemo2.cs(23,23): error CS0161: `InputMethodDemo2.DataEntry(string)': not all code paths return a valueTest Contents [TestFixture] public class DataEntryMethodTest { [Test] public void DataEntryTest() { string consoleInput = "97"; int returnedValue; string expectedString = "Enter third integer";…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…
- Programming Exercise 10 in Chapter 6 asks you find the mean and standard deviation of five numbers. Extend this programming exercise to find the mean and standard deviation of up to 100 numbers. Suppose that the mean (average) of n numbers x1, x2, . . ., xn is x. Then the standard deviation of these numbers is:S=sqrt(((x1-x)^2+(x2-x)^2+...+(xi-x)^2+...+(xn-x)^2)/n)=======================================================================PSET_3 - DESCRIPTION for JAVA PROGRAMMING SET 3=======================================================================The monthly payment on a loan may be calculated by the following formula:Rate * (1 + Rate)^NPayment = ----------------------- * L [note 1]( ( (1 + Rate)^N ) - 1)Rate is the monthly interest rate--expressed as a decimal value,which is the annual interest rate divided by 12.(12% annual interest would be 1 percent monthly interest.) [note 2]N is the number of payments, and ...L is the amount of the loan.-----------------------------------------------------------------------Note 1: '^' means exponentiation; a^b means a to the power of bHint: Use the pow() function in the Math Library.Note 2: To convert from percent to decimal ...Divide the percent value by…=======================================================================PSET_3 - DESCRIPTION for JAVA PROGRAMMING SET 3=======================================================================The monthly payment on a loan may be calculated by the following formula:Rate * (1 + Rate)^NPayment = ----------------------- * L [note 1]( ( (1 + Rate)^N ) - 1)Rate is the monthly interest rate--expressed as a decimal value,which is the annual interest rate divided by 12.(12% annual interest would be 1 percent monthly interest.) [note 2]N is the number of payments, and ...L is the amount of the loan.-----------------------------------------------------------------------Note 1: '^' means exponentiation; a^b means a to the power of bHint: Use the pow() function in the Math Library.Note 2: To convert from percent to decimal ...Divide the percent value by 100.-----------------------------------------------------------------------=======================================================================…
- Drawing a right side up triangle Write a recursive function called DrawTriangle() that outputs lines of '*' to form a right side up isosceles triangle. Function DrawTriangle() has one parameter, an integer representing the base length of the triangle. Assume the base length is always odd and less than 20. Output 9 spaces before the first '*' on the first line for correct formatting. Hint: The number of '*' increases by 2 for every line drawn. Ex: If the input of the program is: 3 the function DrawTriangle() outputs: * *** Ex: If the input of the program is: 19 the function DrawTriangle() outputs: * *** ***** ******* ********* *********** ************* *************** ***************** ******************* Note: No space is output before the first '*' on the last line when the base length is 19. in c++c++ (A) write the definition of the Circle class. (B) Write a test program implementing the relational operators (<, <=, ==, ! =, >, >=) to compare the radius of two circle. See the sample outcome Figure 1. in the test program, your code will perform the followings; (A) Creates two circles with the radius 5 and 6 respectively. (B) Use the operator < and display the area of the circle that has the smaller radius. (C) Use the operator == and display the area of the bigger circle if the two circles are not the same. You need to use one of the operators to determine which radius is bigger.Write assignment statements for the following: Assign a value of 1 to between if n is in the range -k through +k, inclusive; otherwise assign a value of 0 Assign a value of 1 to uppercase if ch is an uppercase letter; otherwise, assign a value of 0. Assign a value of 1 to divisor if m is a divisor of n; otherwise, assign a value of 0.