you have the following statements: int a=2, b=3, c=43; double z=4.5, w=6.7; const float f=8.9%3; The output of the statement: cout<<((a % b) % c);
Q: Given the following statements:int num;int *numPtr;write C++ statements that use the variable numPtr…
A: Statement The statement that uses the variable numPtr to increment the value of variable num is…
Q: If you have the following statements: int a=2, b=3, c=4; double z=4.5, w=6.7; const float f=8.9; The…
A: Here variable a and b are of integer datatype whose initial value are 2 and 3. Datatype of variable…
Q: Write a function that converts milliseconds to hours, minutes, and seconds using the following…
A: Steps to convert milliseconds to seconds, minutes, and hours as follows Total seconds = Milli…
Q: Write a program using if-blocks that allows the user to input a taxable income value into a text…
A: According to the Question below the Solution: HTML: <!DOCTYPE html> <html>…
Q: Write a program for calculating the simple interest on a loan when the initial prin- cipal amount…
A: PROGRAM CODE: public class Main{ public static void main(String[] args) {…
Q: Suppose a, b, and sum are int variables and c is a float variable. What value is assigned to each…
A: b+=c*a ; b = b + c*a = 4 + 3.8*9 = 4 + 34.2 = 38.2 So value of b= 38 Thus a = 9, b= 38, c=3.8 sum=17…
Q: #include int main(void) { printf("welcome!\n You are able to test your skill of writing C…
A: As per our guidelines we are supposed to answer only one question but here i am doing three question…
Q: Assume the following variable definitions: int a = 5, b = 12; double x = 3.4, z = 9.1;What are the…
A: Note: There are multiple questions are given in one question. According to the rule, you will get…
Q: How many times the statement "Statement" is printed in the following code? void fun(int R)…
A: the answer is as follows
Q: Given the following statement: int v = rand() % 86 + 25; What is the range of v? A. [0, 86] B. [0,…
A: Here in this question we have given a code and we have asked to find the range for this variable.…
Q: If you have the following statements: int a=2, b=3, c=4; double z=4.5, w=6.7; const float f=8.9; The…
A: Here we have variable a and b of integer datatype whose initial value is 2 and 3 respectively.…
Q: (int score) Returns how many entries in the scoreboard are greater than or equal to the given score.…
A: Q. Use C++ Programming int exemplary(int score) Returns how many entries in the scoreboard are…
Q: QUESTION 14 To assign a value 1 to variable x, you write O 1 = x; O x = 1, O x = 1, O1 = x; O x ==…
A:
Q: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats)…
A: Given: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both…
Q: What does the following code segment output? Assume that a variable is declared. int x= 5; for (; ;…
A:
Q: Assume you have three int variables: x = 2, y = 6, and z. Choose the value of z in the following…
A: x=2, y=6 The given is a ternary operator. (Condition)? Case1 : case2 If condition is evaluated to…
Q: Suppose that x, y, z, and w are int variables and x = 25, y = 3, z = 12, and w = 4. What is the…
A: Given x = 25,y = 3, z = 12 and w = 4 because option a is not given in question let we start solving…
Q: tch (m) {case 0: printf(" the number is low\n"); break; case 1:
A: Code: #include <stdio.h> int main (void) { int m; printf ("enter an integer number between…
Q: Which is the correct statement in the following? O if (x = 0) cout << "x is zero"; %3D if (x < y <…
A: Here, I have to choose an option for the above question.
Q: Suppose that num is an int variable. Consider the following C++ code. cin >> num;if (num >=…
A: complete code: #include <iostream> #include<cmath> using namespace std; //main method…
Q: IN C# (reject if you can't do C# please): Write an application that runs 1,000,000 games of craps…
A: Answer has been explained below:-
Q: QUESTION 18 To assign a double variable d to an int variable x, you write X = d; X = (int)d; x =…
A: The downgradation of a datatype to it's lower datatype is done automatically by the compiler.
Q: Given the following function: int strange (int x, int y) if (x > y) return x + y; else return X what…
A: GIVEN:
Q: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats)…
A: PROGRAM: #Defining the function deriving_cost def driving_cost(driven_miles, miles_per_gallon,…
Q: If you have the following statements: int a=2, b=3, c=4; double z=4.5, w=6.7; const float f=8.9;…
A: correct coding with Statement #include <iostream>using namespace std;int main(){ int a =…
Q: Suppose that x, y, z, and w are int variables and x = 25, y = 3, z = 12, and w = 4. What is the…
A: a. Program: //include the header file #include <iostream> using namespace std; //definition…
Q: Write a pseudo code that calculates the total point earned by a football team over a series of games…
A: Pseudocode: Start the program Declare score, i = 0, counter = 0, sum = 0 Get the input scores from…
Q: This assignment requires you to plot (in text) a quadratic function at certain points. • Ask the…
A: Correct code def q(a,b,c,x): return a*x**2 + b*x +c def pq(a,b,c,x): print(f'At x= {x} ,y=…
Q: Implement the following: Given: food1 = "Salad" food2 = "Sandwich" price1 = 3.6 price2 = 4.99 Print…
A: food1 = "Salad"food2 = "Sandwich"price1 = 3.6price2 = 4.99 print("Lunch:", food1, f"{'' : <25}",…
Q: What does the following code print out? $cash on hand = 31; $meal = 25; $tax 10; $tip 10; while (…
A: 1) Code in question does below activity It defines below variables and assign them values…
Q: Write a full program that display the area of a rectangle. The program calls the following two…
A:
Q: A java program that works out the charges for the month. The program should accept the following on…
A: //import the required package import java.util.Scanner; //Definition of the main class public class…
Q: Suppose n1 and n2 are two int variables that have been given values. Write anif-else statement that…
A: here in this question we have two variable and we have asked to write if else statement it outputs…
Q: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats)…
A: def driving_cost(driven_miles, miles_per_gallon, dollars_per_gallon): gallons_used =…
Q: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats)…
A: The given program in python is as below: OUTPUT OF THE PROGRAM:
Q: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats)…
A: Lets see the solution.
Q: Evaluate the following expressions, assume the following declarations: int x = 4; int y = 1/2; int…
A: Given x=4 As y is int it takes 1/2=0.5 It take only 0 as it is int. y=0 num=6 num*=x + y num=num * x…
Q: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats)…
A: 1. As per our guidelines we are supposed to answer only one question. Kindly repost the remaining…
Q: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats)…
A: Answer :
Q: Evaluate the following expressions, assume the following declarations: int x = 4; int y = 9/2; int…
A: Given expressions: int x = 4; int y = 9 / 2; int num = 6; num *= x + y;
Q: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats)…
A: Here I have created the function named driving_cost(). In this function, I have divided the miles by…
Q: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats)…
A: As per the given question, driving_cost() function needs to be designed. Input parameters :…
Q: Assume that M is declared as int, and a value is stored in it. How would you check *? whether N is…
A: N is between 3 and 9 So it will be 4,5,6,7,8 Ans is if(M>3 && M<9) This means M is…
Q: Suppose a, b, and sum are int variables and c is a double variable. What value is assigned to each…
A: static_cast<> is a compile time casting. It is used for implicit conversions between types.…
Q: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both…
A: Actually, the given program is: Output each floating-point value with two digits after the decimal…
Q: Given an airplane's acceleration and take-off speed v, you can compute the minimum runway length…
A: The given problem can be solved using simple arithmetic operations in any programming language.…
Q: int a = 5, b = 12; double x = 3.4, z = 9.1; What are the values of the following expressions? A) b/…
A: Here is the program which execute these statements #include<iostream>using namespace std;int…
Q: Suppose x, y, and z are int variables and x = 18, y = 5, and z = 4. What is the output of each of…
A: Given, cout << "x = " << x << ", y = " << y << ", z = " << z…
Q: If you have the following statements: int i=12, j=4; while (i>=1)
A: Lets see the solution.
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
Step by step
Solved in 2 steps
- For the following declaration statements, determine if the statement is valid or invalid, if invalid indicate why. a) int My Age; b) double double_1; c) double Income Tax; d) float gpa = 3.90; e) String Name = ‘Joe’; f) Char MI = M; g) Char Letter = “B”; h) double static; i) double Salary$ = 0.0; j) int _VarM;Fahrenheit to Celsius using multiple statements Given a Fahrenheit value temperatureFahrenheit, write a statement that assigns temperatureCelsius with the equivalent Celsius value. While the equation is C = 5/9 * (F - 32), as an exercise use two statements, the first of which is "fractionalMultiplier = 5/9:". Check if varlables temperatureFahrenheit, fractionalMultiplier, and temperatureCelsius exist Variable temperatureCelsius does not exist. From MatlabWrite a pseudo code that calculates the total point earned by a football team over a series of games and calculate the average of team. It allow the user to enter the series of game points, As soon as the user enters a negative value -1 to program, it should calculate the average test score and display it. Team A series 1 point: 10Team A series 2 point: 5Team A series 3 point: 8Team A series 4 point: 9Team A series 5 point: 12Team A series 6 point: -1Average of Team A =8.8
- Answer this question Write a program that calculates and displays a person’s body mass index (BMI). The BMI is often used to determine whether a person with a sedentary lifestyle is overweight or underweight for his or her height. A person’s BMI is calculated with the following formula:BMI = weight × 703 / height2where weight is measured in pounds and height is measured in inches. The program should display a message indicating whether the person has optimal weight, is underweight, or is overweight. A sedentary person’s weight is considered to be optimal if his or her BMI is between 18.5 and 25. If the BMI is less than 18.5, the person is considered to be underweight. If the BMI value is greater than 25, the person is considered to be overweight(Parking fee) The short-term, 0-24 hours, parking fee, F, at an international airport is given by the following formula: where int(h + 1) is the integer value of h + 1. For example, int(3.2) = 3, int(4.8) = 4. Write a program that prompts the user to enter the number of hours a car is parked at the airport and outputs the parking fee.Phyton In the United States, fuel efficiency for vehicles is normally expressed in miles-pergallon (MPG). In Canada, fuel efficiency is normally expressed in liters-per-hundred kilometers (L/100 km). Use your research skills to determine how to convert from MPG to L/100 km. Then create a program that reads a value from the user in American units and displays the equivalent fuel efficiency in Canadian units
- If int x = 10;, int y = 7;, double z = 4.5;, and double w = 2.5;, evaluate each of the following statements, if possible. If it is not possible, state the reason. (3, 4) (x + y) % x x % y + w (z - y) / w (y + z) % x (x % y) * z x % y % 2 (x + y) % z (x % y + z) / w(Statistics) This is the formula for the standard normal deviate, z, used in statistical applications: z=(X)/ X is a single value. refers to an average value. refers to a standard deviation. Using this formula, you need to write a program that calculates and displays the value of the standard normal deviate when X=85.3,=80,and=4. a. For this programming problem, how many outputs are required? b. How many inputs does this problem have? c. Determine a formula for converting input items into output items. d. Test the formula written for Exercise 7c, using the data given in the problem.4. During each summer, John and Jessica grow vegetables in their backyard and buy seeds and fertilizer from a local nursery. The nursery carries different types of vegetable fertilizers in various bag sizes. When buying a particular fertilizer, they want to know the price of the fertilizer per pound and the cost of fertilizing per square foot. The following program prompts the user to enter the size of the fertilizer bag, in pounds, the cost of the bag, and the area, in square feet, that can be covered by the bag. The program should output the desired result. However, the program contains logic errors. Find and correct the logic errors so that the program works properly. // Logic errors. #include #include using namespace std; int main() { double costs double area; double bagsize; cout > bagsize; cout > cost; cout > area; cout << endl; cout << "The cost of the fertilizer per pound is: $" << bagsize / cost << endl; cout << "The cost of fertilizing per square foot is: $" << area / cost << endl; return 0; }
- 30 Suppose a, b, and sum are int variables and c is a double variable. What value is assigned to each variable after each statement executes? Suppose a = 6, b = 3, and c = 2.2. (14) a b c sum sum = static_cast<int>(a + b + c); __ __ __ __ b += c * a; __ __ __ __ c -= a; __ __ __ __ a *= 2 * b - c; __ __ __ __stoppingDistance = speed * (2.25 + speed / 21)Write a program which determines whether a vehicle’s tailgating distance is safe.The program should read in the speed of the vehicle and the vehicle’s tailgatingdistance. The program should then calculate the distance that would be required tostop the vehicle.If the stopping distance is less than the tailgating distance, your programshould print “No problem.” If the stopping distance equals the tailgatingdistance, your program should print “Minor wreck.” If the stopping distanceis greater than the tailgating distance, your program should print “Majorwreck!”stoppingDistance = speed * (2.25 + speed / 21)Write a program which determines whether a vehicle’s tailgating distance is safe.The program should read in the speed of the vehicle and the vehicle’s tailgatingdistance. The program should then calculate the distance that would be required tostop the vehicle.If the stopping distance is less than the tailgating distance, your programshould print “No problem.” If the stopping distance equals the tailgatingdistance, your program should print “Minor wreck.” If the stopping distanceis greater than the tailgating distance, your program should print “Majorwreck!”Notice that the expression on the right side of the formula above will force thecompiler to convert everything to type double. Use type double for your workingvariables. Write your program so that it is able to produce the following screendisplay:Sample session:Enter your speed (in mph): 60.0Enter your tailgate distance (in feet): 240.0Major wreck!