Question

In: Computer Science

1. Make the flow diagram and the C ++ program that receives three integer values ​​R,...

1. Make the flow diagram and the C ++ program that receives three integer values ​​R, T and Q, determine if they satisfy the expression below, and if so, show the corresponding values ​​of R, T and Q. R'- T '+ 4 * Q? <820

2. Construct a flow chart and the corresponding program in C which, when receiving Y as data, calculates the result of the following function and prints the values ​​of X and Y.

Solutions

Expert Solution

1. C++ program to accept three values and checks the conditions

Flow chart

Source Code

#include<iostream>
using namespace std;
int main() {
        int R,T,Q;
        cout<<" Enter value for first number:";
        cin>>R;
        cout<<" Enter value for second number:";
        cin>>T;
        cout<<" Enter value for third number:";
        cin>>Q;
        if(R-T+4*Q<820) {
                cout<<" The values for R :"<<R<<" T:"<<T<<" Q:"<<Q;
        }
        return 0;
}

The output:

Enter value for first number:12
Enter value for second number:60
Enter value for third number:45
The values for R :12 T:60 Q:45

2. C++ program to accept two values and check conditions

Flowchart:

Source code:

#include<iostream>
using namespace std;
int main() {
        int X,Y;
        cout<<" Enter value for first number:";
        cin>>X;
        cout<<" Enter value for second number:";
        cin>>Y;
        
        if(X>Y) {
                cout<<" The values of variables  X :"<<X<<" and Y:"<<Y;
        }
        return 0;
}

Output


Related Solutions

Make a program that swaps the three values. Three integer values are taken from the user...
Make a program that swaps the three values. Three integer values are taken from the user input. This work will be done by calling the function "getinput(num1, num2, num3)" The input values are swapped each other by calling the function swap(num1, num2, num3) example: values (a, b, c) will be (c, a, b) after the swap. a = 10; b = 20; c = 30; after function call, a has 30, b has 10, and c has 20.
c++ Write a program that will ask the user for three pairs of integer values. The...
c++ Write a program that will ask the user for three pairs of integer values. The program will then display whether the first number of the pair is multiple of the second. The actual work of making the determination will be performed by a function called IsMultiple that takes two integer arguments (say, x and y). The function will return a Boolean result of whether x is a multiple of y.
Write a C program that allows: Three integer values to be entered (read) from the keyboard,...
Write a C program that allows: Three integer values to be entered (read) from the keyboard, Display the sum of the three values on the computer screen as follows: The integers that you have entered are: a b c The sum of a , b & c is ______ Thank you! C Code: Output screen:
The Classic Triangle Testing Problem, (Myer's Triangle): A program reads three integer values. The three values...
The Classic Triangle Testing Problem, (Myer's Triangle): A program reads three integer values. The three values are interpreted as representing the lengths of the sides of a triangle. The program prints a message that states whether the triangle is scalene, isosceles, or equilateral. Develop a set of test cases (at least 6 ) that you feel will adequately test this program. (This is a classic testing problem and you could find numerous explanations about it on the internet. I would...
Q#1 Write a C++ program that reads n integer values and stores them in an array...
Q#1 Write a C++ program that reads n integer values and stores them in an array of maximum 20 integers. Read from the user a valid value of n (n should not exceed 20). After reading the n array elements find the maximum and minimum elements. Q#2 Write a C++ program that reads 10 integer values and stores them in an array. The program should find and display the average of the array elements and how many elements are below...
Let a , b , c be three integer numbers. Write a C++ program with a...
Let a , b , c be three integer numbers. Write a C++ program with a functions void rotate1(int* a,int* b,int* c) void rotate2(int& a,int& b,int& c) such that a -> b , b -> c and c -> a. Thus we use two different approaches (pointers in rotate1 and references in rotate2).
Write a C program to Declare an integer array of size 10 with values initialized as...
Write a C program to Declare an integer array of size 10 with values initialized as follows. int intArray[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; Compute each item of a new array of same size derived from the above array by: adding first item (intArray[0]) of the array with 3rd, 2nd with 4th, 3rd with 5th and so on. For the last-but-one item intArray[8], add it with first item and for the last item (intArray[9])...
• Write a C++ program that asks the user to input two integer values, then calls...
• Write a C++ program that asks the user to input two integer values, then calls a void function "swap" to swap the values for the first and second variable. • As we mentioned before, in order to swap the valors of two variables, one can use the following: temp= variable1; variable1 = variable2; variable2 = temp; • Display the two variables before you call swap and after you call that function. Comment in code would be greatly appreciated to...
In C ++, Design and implement a program that reads from the user four integer values...
In C ++, Design and implement a program that reads from the user four integer values between 0 and 100, representing grades. The program then, on separate lines, prints out the entered grades followed by the highest grade, lowest grade, and averages of all four grades. Format the outputs following the sample runs below. Sample run 1: You entered:    95, 80, 100, 70 Highest grade: 100 Lowest grade:   70 Average grade: 86.25
1) type a complete, working, C++ program that accepts two integer values from the variable num3,...
1) type a complete, working, C++ program that accepts two integer values from the variable num3, and store num1 raised to the power num2 into the variable num4. Then output the values of the four variables each on a separate line, formatted and with an appropriate message for each.keyboard into the variables num1 and num2, include prompts, store the square root of their sum into the program :
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT