int p = 200; int q = 100; if(p%2==0){ q = q/50; } else{ q = q/100; } q = ? What will be the final value of q . In C++
Q: in this code, the integer on each line shows the line number that is not part of code: what is he…
A: Answer:- Variable x, y and z are the local variables of sum function. Here parameters are also…
Q: Write a C++ program that match the struct below: Are you student in AL- Khwarizmi college? (y/n)…
A: We need to provide c++ code according to Scenario given in flowchart
Q: 4) Run the code in C++ below and explain why the c value is different after the second if statement…
A: Given code: #include <iostream> using namespace std; int main(){ int t,a,c;…
Q: Write an application that reads an integer and determines and prints whether it’s odd or even.…
A: Output 1: Output 2:
Q: void change( int a[]) , the compiler converts the parameter to: Select one: a. int *const a b. int…
A: The compiler changes void change(int a[]) silently to void change(int *const a) at the time of…
Q: Q4, a mechanical pump whose rated speed is (Sm=15 cfm) is connected by a pipe and valve to a vacuum…
A: Please refer to the following steps for the complete solution to the problem above.
Q: Science P4.13The dew point temperature T. can be calculated (approximately) from the relative…
A: We have to write JAVA Code for following question:
Q: In this question, you will implement the famous Guess the Number game in C as we've done in the…
A: Use an infinite loop till computer guesses the number Make the mid element of range as the computer…
Q: C++ This is what i have as a solution. Can you check If this makes sense according to the question…
A: // Destructor Train::~Train() { // current node Car *curr = tHead; // iterate through…
Q: Write a c++ program Write a program that ask sthe user to enter the value of four angles (in…
A: #include<iostream> // It is "iostream" is C++ standard library which helps to implement…
Q: public static int myMethod (int y, int z) { if (y > z) return y * z; else return myMethod (y - 2,…
A: In this problem, we need to give a condition when will the stack overflow condition will occur.…
Q: Write the function parrotTrouble. *
A: Approach Create a public class named ParrotTrouble Define method parrotTrouble that returns true…
Q: In C, Given an int variable n that has already been declared, write some code that repeatedly reads…
A: //include the required header file #include <stdio.h> //define main function int main() {…
Q: Note: Use else-if statements
A: Programming approach: In the main function Input name. Input reg_num. For loop to input 5 elements…
Q: Write a program in c# named DogBoarding that accepts the weight of a dog and the number of days it…
A: Please find the answer below :
Q: CENGAGE | MINDTAP Q Search this course ROSE fuwdhart Woz Writing a Modular Program in C++ Writing a…
A: Flowchart is pictorial diagram of an algorithm. It is used to show, how an algorithm works. It has…
Q: Write a C++ program to calculate a rectangle's area. The program consists of the following function:…
A: logic:- define function getLength(),getWidth() that returns length and width respectively. Define…
Q: Control structures: In Java only please. Output the position of the largest number and the largest…
A: import java.util.Scanner; public class Main { public static void main(String[] args) {…
Q: What is the value of var after running the following piece of C code? int var-10; if (var10) var -…
A: Given code: int var =10; if(var<20) { var = var +5; if (var >10) { var = var +10; } else{…
Q: Write a simple calculator which supports add subtract multiply and divide. Prompt the user for two…
A: Java program to make a simple calculator and prompt the user to choose an operation from the given…
Q: Write an application that inputs three integers from the user and displays the sum, average,…
A: Sir, you didn't mention any programming language, hence according to bartleby policy, I have…
Q: Write a program in C that asks the user to insert the temperature value in Celsius (°C). The program…
A: Algorithm: Start Read temperature in Celsius Calculate fahrenheit=(celsius*9/5)+32 Print fahrenheit…
Q: Write a program named TestScoreList that accepts eight int values representing student test scores.…
A: Logic:- Input 8 marks from user and store it in array. calculate average first and then using loop…
Q: By using Loop in c++, you are responsible to develop a Credit Limit Calculator, which will determine…
A: Find Your Code Below
Q: In my C++ program, I am trying to write code that will check command line arguments for "-amount"…
A: Note:The expression “floor(x)-x!=0” can be used to check whether the value of “x” is a double…
Q: Write a complete C++ program that: A wholesale furniture store that sells tables in bulk needs a…
A: In this program, all parts are calculated including the third one. Here I have taken input from the…
Q: A wholesale furniture store that sells tables in bulk needs a program to help their cashiers. Write…
A: Required: Required code with comments for explanation and screenshot of both code and output has…
Q: The charge for all signs is a minimum of $35.00. The first five letters or numbers are included in…
A: Input count of characters, make and color and based on them add respective costs Print final cost
Q: int fun(int x, int y) { if (y == 0) %3%3D return 0; return (x + fun(x, y-1)); int fun2(int a, int b)…
A: To do: Explain the given Program
Q: write a program in c++ in which A Paint Company has asked you to write an application that…
A: Note: Formula for calculating the area of a room is considered as length * width. area = length *…
Q: In C, numbers can be written in several ways. For the following data type, enter a number in the…
A: C format specifier: The C programming language has a different format specifier for a different type…
Q: Write a C Program that allows a user to enter any number of student test scores until the user…
A: EXPLANATION: - A do...while loop is used to read the scores of the students till 999 is not entered…
Q: This is part of my hangman simulation in C++. If you compile and run it and type "Easy," the code…
A: Answer:
Q: Question: (Code must be in java language) Assuming that you have the functions “drawPolygon(int[]…
A: As Describe above - No need to write the definition of the methods, there are no marks for…
Q: Hi this is a C program. I need you to convert it to C++. make sure its working thank you here is…
A: Dear learner , hope you are doing well , I will try my best to answer this question. Thank You!!
Q: The Goal of this project is to write a program in C++that calculates car rental amounts (for an…
A: - The question is to code the given scenario of hours.
Q: write an extension method called toRoman to convert and int to its roman r
A: //Program using System; using System.Collections.Generic; using System.Linq; using System.Text;…
Q: basic java please Write a method called findTip that finds the value of a meal as a double…
A: In this code, a function named findTip is called in the main function and the tip is added to the…
Q: Write a C# console application named DivisionApp that accepts two integers from the user. The first…
A: using System; class DivisionApp { static void Main(string[] args) { int divident,…
Q: Write a program in C++ that converts square meter into ping. The program prompts the user to enter a…
A: Below is the required C++ program: - Approach: - Including the header file “iostream” and using the…
Q: • Write an application that inputs one number consisting of 3 digits [for example 125] from the…
A: using System; public class RecExcerise4 static void main() { console.write("\n\n recursion:…
Q: int x, y, z; x-3; int a, b, z; a=l; b-4; y=7; z=9; if(x>y) if(x-y4) while (acb) { a=2*a; b=b+l;…
A: given code on c++ we need to provide the output of the codes, please see the answer in step 2. note:…
Q: Write a program in c++ to generate a random number between 1 - 100, and then display which quartile…
A: Program plan:Include the required header files into the program.Define the main function.Declare the…
Q: Create a loop-based C++ application that prompts for a positive integer and prints the factors of…
A: Code: #include <iostream> using namespace std; int main(){ int n; cout<<"Enter…
Q: TTTT Vrite a function in Java that implements the following logic: Given a number n, return true ifn…
A: Logic:- if n>=1 && n<=10 return true else if(outsideMode==true) If(n<=1 ||…
Q: Please provide code in C# Mad Libs is a game where the player selects words based on part of speech…
A: Program using System;public class Madlib{ public static void Main() {…
Q: The probability p of two people having the same birthday in a group of n people is p(n) = 1-q, where…
A: First, we need to read the size of the group and then compute the value of q and then p as per the…
Q: Using C#, write a program that takes a decimal value between 1 and 10 and displays its equivalent…
A: This can be done using basic condition check and here we provided solution using switch statements
int p = 200;
int q = 100;
if(p%2==0){
q = q/50;
}
else{
q = q/100;
}
q = ?
What will be the final value of q .
In C++
Step by step
Solved in 4 steps with 1 images
- In C++ Write a program that can be used to calculate the federal tax. The tax is calculated as follows: For single people, the standard exemption is $4,000; for married people, the standard exemption is $7,000. A person can also put up to 6% of his or her gross income in a pension plan. The tax rates are as follows: If the taxable income is: Between $0 and $15,000, the tax rate is 15%.Between $15,001 and $40,000, the tax is $2,250 plus 25% of the taxable income over $15,000.Over $40,000, the tax is $8,460 plus 35% of the taxable income over $40,000. Prompt the user to enter the following information:Marital statusIf the marital status is “married,” ask for the number of children under the age of 14Gross salary (If the marital status is “married” and both spouses have income, enter the combined salary.)Percentage of gross income contributed to a pension fund Your program must consist of at least the following functions:Function getData: This function asks the user to enter the…Control structures: In Java only please. Output the position of the largest number and the largest number in the squence a0, a1, a2....ak. For example, the largest number of the squence is 75, 226, 113, 340, 170, 85, 256, 128, 64, 32, 16, 8, 4, 2, 1 is 340, and it's position is 4. Test your program for the following values of x: 75, 111, 678, 732, 873, 2048, and 65535. Thank youThe below code is the code that it’s mentioned in the question! Please write your in C language, and put it in text so i can copy it! Thanks
- in Python please. I have this so far def time(charge): if charge == 15 or charge == 20: return 0 elif charge == 35: return 6 elif charge == 60: return 7 elif charge == 120: return 16 You buy an international calling card to India. The calling card company has some special offers. If you charge your card with $15 or $20, you don't get anything extra. For a $35 charge, you get $6 of extra phone time. For a $60 charge, you get $7 of extra phone time. For a $120 charge, you get $15 of extra phone time. Write a function that asks the user for the amount he/she wants on the card and returns the total charge that the user gets. Note: Values other than those mentioned earlier are not allowed. Include appropriate comments to make your code more readable.C Programming Write a program that reads an integer from the user (keyboard), namely n. Yourprogram should print all positive numbers that are smaller than n and whosedigits sum up to a perfect square number.(An integer is a perfect square if it hasan integer square-root for example 25) You should print the numbers in ascendingorder and print their digits separated by “:“ symbol from the least significant digitto the most significant digit on the same line as the number. At the end of eachline you should also print the sum of the digits of the number. Example:If the user enters n : 30, then the output should be as follows:1 1 14 4 49 9 910 0:1 113 3:1 418 8:1 922 2:2 427 7:2 9write a program in C++ that A user needs to determine the size of squares (let say delta) in a grid, the center of the circle (does not have to lie on a grid but it can!) and the radius. (for example use "cin>>" ) Then you need to plot a circle using parametric equations of circle (you need to increase angle and plot these (in my picture black) points). First plot the first point of the circle and determine in which square of grid it is. (in my picture it is an orange square) and plot the left bottom vertex of this square (in my picture it is a blue point). Then increase an angle and plot next point of circle - check if it lies in different square. -If it is not in different square, you need to increase angle and check again. (because an angle was too small) -If it is the different square, then check, if this square has THE COMMON EDGE with the previous one -> if it has the common edge, then print new left bottom vertex of this square (if does not have common edge,…
- In C, Given an int variable n that has already been declared, write some code that repeatedly reads a value into n until at last a number between 1 and 10 (inclusive) has been entered.in java If b is 7 and c is 10, the value of c after the following statement is executed is _____. c *= b--;In C++, write a program that calculates and prints a monthly paycheck for an employee. The net pay is calculated after taking the following deductions from the employee's gross salary: Federal Income Tax: 17.5% State Tax: 9.1% Social Security Tax: 6.2% Medicare Tax: 1.45% Retirement Plan: 9.29% Health Insurance: $51.48 Life Insurance: $3.71 Your program will prompt the user to input the employee ID, the employee name, and the employee's monthly gross salary. The program will calculate the deductions listed above, along with the percentage of take home pay (defined as the net pay divided by the gross salary). After calculating each deduction and percentage, the output will be printed to the screen (see example output below). Requirements All decimal numbers must be formatted to 2 decimal places. Ask for the employee's ID first, then full name (can include spaces), then the salary. The prompt to enter the salary must include the employee name. The employee ID MUST be…
- a. Write a c program that asks a user for an integer. Declare a variable num3. Let num3 = --x; Display the values of x, and num3.b. Write a c program that asks a user for an integer. Declare a variable num4. Let num4 = x--; Display the values of x, and num4.Write a program in c++ that takes in a year as input (as a command line argument) and prints the string "{year} was a leap year'' if true and "{year} was not a leap year'' if false.Note: background on leap year https://en.wikipedia.org/wiki/Leap_yearHere is a possible example call to the program .\isleapyearc 1896 output: 1896 was a leap year Here is a negative example call to the program .\isleapyearc 1897 output: 1897 was not a leap yearThe Goal of this project is to write a program in C++that calculates car rental amounts (for an online 24/24 service).The rental rates are as follows: •From 00:00 am to 06:59 am and from 17:00pm to 24:00pm: 8 dollar/hour •From 07:00 am to 16:59 pm: 10 dollars/hour The program will ask the user to enter the start and end hours of the rental as integers and will compute and display the rental cost. You will adopt the following simplifications: •the hours are integers (we don’t mind about minutes; each started hour will be fully paid); •the start time (i.e., hour) of the rental period must always be less than the end time (i.e., hour) of the rent. This means that one cannot hire a car for more than 24 hours and that each rental period must lie within the same day.