Write C++ code for the following flowchart and answer the following questions : (1) If N =7 and X=y what will be the output ? (2) If TERM = -1 What will be the output? %3D Start input vake of N, X SUM -1 TERM =1 I>N TERM- TERM x SUM = SUM +TERM Priet SUM =1+1 SIOP
Q: When you deposit money in a savings account at a bank, the bank pays you interest on that money. If…
A: Here our task is to implement a c# program that calculate the total amount after n years deposited…
Q: PLEASE USE THE SWITCH-CASE STATEMENT FOR THIS PROBLEM The Kingdom of Aleria uses gold coins and…
A: Given, 1 gold=15 silver 18 silver=30 nickel So, 1 gold=15 silver=(30/18)×15=1.667×15 nickel 10…
Q: 4. Answers questions above The following flowchart describes the battery management system. Write…
A: Find the required code in matlab given as below and output : As per company guidelines we are…
Q: Draw a flowchart of the following code, and show the output if x = -3 and y = 3.
A:
Q: Consider the following flowchart: false false false n==0 n==1 print('D') true true true print('A')…
A: Please find the answer below :
Q: Write a C++ program to estimate your water bill for next quarter. Your water meter measures the…
A: Introduction : Here we have to write a C++ program to estimate your water bill for next quarter.…
Q: A mobile company charges the following rates to the user: For first 5 mins = $5 For next 10 mins =…
A: The input will be name along with minutes of usage and then final bill is calculated and displayed
Q: Draw a flowchart for a C-POGRAM that must solve the following problem. 1. XYZ is an application…
A: Note: You have asked only flowchart that why providing algorithm and flowchart only In this…
Q: QUESTION 6 Write a complete C++ program based on the following flowchart: Begin N = 55 Count = 1…
A: #include <iostream>using namespace std; int main() { int N=55; //declare N int guess;…
Q: 11. What is the output for the following flowchart? 2 start x=5, n=1 ,m=1 Print n,m Increment n by 2…
A: Given Flow chart
Q: 6-In K Write the equivalent C++ statement for the following Math formu -2*(x*x' 'y)*(-9*(x*y)+12*(x'…
A: Input of program : for formula 1: b,c,K,L for formula 2: x,y In C++: The * sign is used for…
Q: A company selling household appliances gives commissions to its salesman determined by the kind of…
A: Procedure Followed: Include header files. Start main method. Declare variables:…
Q: I am trying to write a C program to find the percentage of marks obtained when the user enters marks…
A: Program is absolutely right. Run it properly here i am attaching screenshot of program and output…
Q: SUBJECT:C PROGRAMMING QUESTION: Draw the flowchart then write the C program using else if. The…
A:
Q: Write a program emu8086to display your name nine times using a call and jump or loop statement
A: ; Macro for printing messages printmsg macro msgpush axpush bxpush cxpush dxLEA dx,msg ; Lead the…
Q: Write pseudo code and design flowchart that will count all the count all the even numbers up to a…
A: Flow chart: It is used to represent program steps in the pictorial representation. Using the flow…
Q: Please write a c++ programming code that can work on codechum according to the instructions below.…
A: Algorithm: Input the rate of consumption from the user Calculate the total cost as follows. If the…
Q: In C++, choose the incorrect way to write the following condition? yx)||(y<z)) II. (y<x)&&(x<z)) O I…
A: y<x<z : means : x is greater than y and x is less than znowso correct answer would be:(x is…
Q: CREATE A PSEUDOCODE FOR THE FOLLOWING FLOWCHART:
A: Pseudocode is an artificial and informal language that helps programmers develop algorithms.
Q: write a program which accept days and integer variable and display total number of years, month and…
A: Actually, program is a executable software that runs on a computer.
Q: Write an OCTAVE code that calculates the tip based on amount of bills, using the following rules and…
A: Flowchart: Oval symbol to indicate the start and end of the program. Parallelogram symbol to read…
Q: Write a program using flowchart (or python, c++) that computes for the average of scores of a…
A: C++ code: #include <iostream>using namespace std; int main() { int marks[99], m, i, a=0,…
Q: Let the following variable is declared in the C++ program as (int X;). Write one statement that…
A: cout is the keyword used to print if is the keyword used to check the condition
Q: Q.4) Write a C++ program for the following flowchart Start 5-0 enter p dividable Isp even? by 37 yes…
A: The algorithm given: Start the loop with s = 0 Ask the user to enter the value of p. Check whether…
Q: - 0170: Analyze the following flowchart and ask yourself these questions: a) Is the flowchart a…
A: a) This flowchart is somewhat fictitious, and it does not satisfy the one-entry one-exit rule of…
Q: Write a C++ code: If you input a number it keeps doubling till it hits 1million or over. So the…
A: The answer is as follows:-
Q: C PROGRAMMING- show the table of values for x,y and z that is the output displayed by the program-…
A: here the function sum takes two variable as a value and one values as a pointer , so the function…
Q: 1. #include int main() { int n, count, sum=0; printf("Enter a positive…
A:
Q: You are asked to write a C program that will accept representing the number of dollars and cents to…
A: Program when only cents are given: #include<stdio.h>void convert(int change){int i;// required…
Q: If A = 15 & B= 4, what will be the answer in the variable X if you execute the following formula in…
A: In the given question the value of A is given as 15 and B is given as 4. Here X is given as…
Q: The Kingdom of Aleria uses gold coins and other metals for their money and their exchange rate is as…
A: Given: 50 copper = 10 nickel 30 nickel = 18 silver 15 silver = 1 gold Let g represents gold, s…
Q: You are required to write a pseudocode and draw a flowchart for a program to determine total marks…
A: The Pseudo Code to implement the given program is: START Declare the variable to store Username as…
Q: Choose the appropriate Question for the following Flowchart
A: Consider the given flowchart :
Q: 10. Consider the following flowchart: Output FALSE NO Is n mod i=0? NO YES STOP Output TRUE Which of…
A: ANSWER: Neither If you check this condition statement in the flowchart. And check the algorithm…
Q: The Kingdom of Aleria uses gold coins and other metals for their money and their exchange rate is as…
A: Algorithm: Start Read no.of gold coins n Ask user's choice of unit output (S- silver, N-Nickel, C-…
Q: Python Help Write a program that asks the user to enter two numbers. The program is supposed to add…
A: Create two variables one for input if user want to continue the operation and one for sum Let the…
Q: (2)Write the algorithm and draw a flowchart to calculate the value of Z. using the Visual basic C ++…
A: Find the required code in C++ given as below and sample output :
Q: Q.3) Write C++ code for the following flowchart and answer the following questions : (1) If N =7 and…
A:
Q: If A = 15 & B = 4, what will be the answer in the variable X if you execute the following formula in…
A: Utility of operator precedence in C: When a mathematical equation is evaluated in C, valid operator…
Q: N=N-M 10-0 START A, B M = A N=B N = M N<M M = M-N N STOP f the inputted values to A and B are 115…
A: A flowchart is a type of diagram that represents a workflow or process. A flowchart can also be…
Q: PLEASE WRITE FLOWCHART FOR THESE CODES, THEY ARE IN ONE QUESTION I JUST NEED THE FLOWCHART FOR THEM,…
A: Note: Answering the first question as per guidelines. Task : Given the C Code. The task is to…
Q: Write a C++program to estimate your water bill for next quarter. Your water meter measures the…
A: Required: Write a C++program to estimate your water bill for the next quarter. All the code with…
Q: Write a complete C++ program that 1) Prompts the user to enter from the keyboard two numbers of type…
A: I give the code in c++ along with output and code screenshot
Q: Q.4) Write a C++ program for the following flowchart Start S-0 enter p dividable S =p+ s Is p even?…
A: According to the Question below the program: Output:
Q: This progran will output a parallelogram. How long do you want each side to be? 5 Please enter the…
A: 1. Implementation of the repeatChar(numRepeats, outputChar) method: def repeatChar(numRepeats,…
Q: Draw a flowchart that will swap the data of variables A and B, C and D, and E and F, where A 20,…
A: SUMMARY: - hence we discussed all the points.
Q: 10. Consider the following flowchart: Output FALSE NO Is n mod i=0? NO YES STOP Output TRUE Which of…
A: If we consider Part B option we can see that condition if(nmod i=0) is…
Q: What value will be assigned to the numeric variable x when the following statement is executed x 4 \…
A: In this program, we have an statement x= 4 / 2 *4 Found out the output value of x. As the language…
Step by step
Solved in 4 steps with 4 images
- Suppose that num is an int variable. Consider the following C++ code. cin >> num;if (num >= 0)switch (num % 3){case 0:num--;break;case 1:++num;break;case 2:num = static_cast<int>(pow(num, 3.0));break;} else{num = -num;num = static_cast<int>(sqrt(num * 1.0));}cout << num << endl;a. What is the output if the input is 7?b. What is the output if the input is 23?c. What is the output if the input is 20?d. What is the output if the input is -9?PLEASE WRITE FLOWCHART FOR THESE CODES, THEY ARE IN ONE QUESTION I JUST NEED THE FLOWCHART FOR THEM, PLEASE HELP. 1 #include<stdio.h> int main(void) { //dec;aring variables int A,B,C,D; int maximum,max1,max2; int minimum,min1,min2; printf("please enter first number\n A:"); scanf("%d",&A); printf("please enter second number\n B"); scanf("%d",&B); printf("please enter third number\n C"); scanf("%d",&C); printf("please enter fourth number\n D"); scanf("%d",&D); //DIVIDE THE 4 NUMBERS TO TOW GROUPS if(A>B) { max1 = A; } else max1 = B; if(C>D) { max2 = C; } else max2 = D; //check the maximum od each GROUP if(max1>max2) { maximum=max1; } else maximum=max2; printf("maximum=%d\n",maximum); if(A<B) { min2=A; } else min2=B; if(C<D) { min2=C; } else min2=D; if(min1<min2) { minimum=min1; } else printf("minimum =%d",minimum); //print the…Consider the following C++ code snippet. What will be the output? char goAgain = 'y'; char lower; lower = tolower(goAgain); cout << goAgain << " " << lower << endl; A) y Y B) Y y C) y y D) Y Y E) We can't be sure; output will depend on the compiler
- . Write a program that will calculate the account balance after we deposited the amount of money for a given period (in years) with interest rate. The program shall ask the user to input the amount (m), period (n) and interest rate (r). Write a local function that will calculate the balance (B). Display the result of the balance calculation. Use the formula below for the balance. Save program as LE9-2.m and flowchart/pseudo-code as LE9-2.png or LE9-2.txt. B=m∗(1+r)nYou are tasked with writing a c++ program that computes a slightly complex formula. The formula is given below: y = 1 + (nx/1) + (n(n-1)x^2/2) + (n(n-1)(n-2)x^3)/6 Write a c++ program that prompts the user to input the values for n and x. The program should then compute the value for y using the above formula and display it.Note: n can only take non-negative integer values, but x can take any real values. You MUST specify appropriate datatype for your variables, accordingly.Create a flowchart and a C program for the following: Accept the room number, room capacity and the number of students enrolled in the semester. Output whether the room is “FULL” or “NOT FULL”. (Do not use Java, use only C++ programming that can be compiled in Dev C++ software)
- What is the output of the following C++code? int x = 15; int y = 3; if (x + y > {y = x -x = y +cout << x << " " << y << " " << x + y << " " << y - x << endl;}else{x = y - x + y %5;cout << x << " " << y << " " << x - y << " " << x + y << endl; }If the following code segment compiles correctly, what do you know about the variable x? if(x) WriteLine(OK); a. x is an integer variable. b. x is a Boolean variable. c. x is greater than 0. d. none of theseI am trying to write a code in C++ to output the sum of the square of the odd numbers between 2 user input numbers (firstNum and secondNum). The code below is what I have, but it isnt working. Assignment due at midnight! number = firstNum;sum = 0;do{(number % 2 == 0); sum += (number * number);number++;number++;continue; }while (number <= secondNum);cout << "sum = " << sum << endl;cout << endl;
- I need your help with the question attached, Your writing your program in C# . When writing or printing out the output of your code please use the format when writing your code and when you want to print out the data too static void Main(string[] args) { int student_id; int student_pass, highest_avgerage_id, student_fail; student_pass = 0; student_fail = 0; highest_avgerage_id = 0; Console.Write("Enter a student id (0 to quit): "); student_id = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Number of student who are moving on: " + student_pass); Console.WriteLine("Number of student who are not moving on: " + student_fail); if (student_id == 0) { is_continue = false; break; } This is the format I need any tutor working on this to use when they are solving the problem and writing the code in C# please. Please let me know if…Write a C program that reads integer values from stdin, separated by one or more spaces or newlines, until reaching EOF. Once we have entered all our integers, we may have to press Enter before pressing Ctrl+d. This signifies that we do not have to create a function, we can implement this vertical histogram program within our main(...) function. Save your program as verticalHistogram.c The input contains no more than 80 values. Why? Because a standard terminal window is 80 character-columns across. The input is guaranteed to be well-formed. On standard output (stdout), it renders a simple vertical column graph representation of the input values (i.e., a vertical histogram), in order left to right, using hash '#' characters as shown in the examples on the next slides. The number of hashes '#' printed in each column should be equal to the corresponding input value. The area above a completed column should be filled with space characters. Ignore empty…Write a C program that reads a double value (x) from the user and then uses it to compute the value of the mathematical constant e to the power of x (ex) and print it in main using the following infinite series: ex =1+x/1!+x2/2!+x3/3!+x4/4!+... Your program should include the following three functions: 1- function called powerOfNumber which takes two parameters: x (double) and y (integer) and returns the value of xy . Function PowerOfNumber MUST use a while loop. ( Not allowed to use the predefined function pow in math.h). 2- function called factorialOfNumber which takes one parameter x (integer) and returns its factorial. Function factoriaOfNumberl MUST use a for loop. 3- function called computeExpo which receives one parameter x (double) and returns the value of ex for the given x using the series above as well as functions powerOfNumber and factorialOfNumber ( 1 and 2 above) . Function computer_ex MUST use a do/while loop. The loop should stop 1 when the new term…