Question

In: Computer Science

All program should be in C Write its pseudocode and draw its flowchart) to prompt the...

All program should be in C

Write its pseudocode and draw its flowchart) to prompt the user to input the variables to solve the following problem:

X2 + X×Y/Z - W*V3

Note 1: You should ask the user to input 5 numbers to be able to do this calculation.

Note 2: You can use multiplication instead of power if you do not want to use it (as we have not officially covered it).

Write a program (compile and run), pseudocode, and draw a flowchart for each of the following problems:

a) Obtain three numbers from the keyboard, compute their product, and display the result.

Ans:

b) Obtain two numbers from the keyboard, and determine and display which (if either) is the smaller of the two numbers.

Ans:

c) Obtain a series of positive numbers from the keyboard, and determine and display their average (with 4 decimal points). Assume that the user types the sentinel value -1 to indicate "end of data entry."

Ans:

Solutions

Expert Solution

running code.

#include <stdio.h>

int main()
{
    
    // first
    double x, y, z, w, v;
    printf("Enter x, y, z, w, v.\n");
    scanf("%lf%lf%lf%lf%lf", &x, &y, &z, &w, &v);
    double x2 = x * x;
    double v3 = v * v * v;
    printf("Answer: %lf\n\n", x2 + x*(y/z) - w*v3);
    
    // second
    printf("Enter x, y, z.\n");
    scanf("%lf%lf%lf", &x, &y, &z);
    double ans = x * y * z;
    printf("Answer: %lf\n\n", ans);
    
    // third
    printf("Enter x, y.\n");
    scanf("%lf%lf", &x, &y);
    double min;
    if(x < y) {
        min = x;
    } else {
        min = y;
    }
    printf("Minimum: %lf\n\n", min);
    
    // fourth
    printf("Enter series of numbers, -1 to end\n");
    double s = 0.0;
    int c = 0;
    do {
        scanf("%lf", &x);
        if(x != -1) {
            s += x;
            c++;
        }
    } while(x != -1);
    printf("Avearage: %lf\n", s/c);
    
    return 0;
}

Related Solutions

6. Write a program in C programming (compile and run), a pseudocode, and draw a flowchart...
6. Write a program in C programming (compile and run), a pseudocode, and draw a flowchart for each of the following problems: a) Obtain three numbers from the keyboard, compute their product and display the result. b) Obtain two numbers from the keyboard, and determine and display which (if either) is the smaller of the two numbers. c) Obtain a series of positive numbers from the keyboard, and determine and display their average (with 4 decimal points). Assume that the...
-Draw a flowchart and pseudocode for a program that produces a monthly bill for a cell...
-Draw a flowchart and pseudocode for a program that produces a monthly bill for a cell phone customer. -List at least 10 separate modules that might be included. - For example, one module might calculate the charge for daytime phone minutes used. - -Make a working version of this program using Python. Need all of the above answered including the correct code for program using python
DESIGN A FLOWCHART IN FLOWGORITHM AND WRITE THE PSEUDOCODE Number Analysis Program Design a program that...
DESIGN A FLOWCHART IN FLOWGORITHM AND WRITE THE PSEUDOCODE Number Analysis Program Design a program that asks the user to enter a series of 20 numbers. The program should store the numbers in an array and then display the following data: The lowest number in the array. The highest number in the array. The total of the numbers in the array. The average of the numbers in the array. PLEASE AND THANK YOU
Draw a structured flowchart or write pseudocode that describes the process of guessing a number between...
Draw a structured flowchart or write pseudocode that describes the process of guessing a number between 1 and 100. After each guess, the player is told that the guess is too high or too low. The process continues until the player guesses the correct number. Pick a number and have someone try to guess it by following your instructions. Submit the flowchart or pseudocode and the results of your test. Create a python program based on your flowchart or pseudocode....
Write a Python program that: Create the algorithm in both flowchart and pseudocode forms for the...
Write a Python program that: Create the algorithm in both flowchart and pseudocode forms for the following requirements: Reads in a series of positive integers,  one number at a time;  and Calculate the product (multiplication) of all the integers less than 25,  and Calculate the sum (addition) of all the integers greater than or equal to 25. Use 0 as a sentinel value, which stops the input loop. [ If the input is 0 that means the end of the input list. ]...
write a program to perform the following in C Your program should prompt the user to...
write a program to perform the following in C Your program should prompt the user to enter ten words, one at a time, which are to be stored in an array of strings. After all of the words have been entered, the list is to be reordered as necessary to place the words into alphabetical order, regardless of case. Once the list is in alphabetical order, the list should be output to the console in order. The program should execute...
write pseudocode for the following problems not c code Pseudocode only Write a C program to...
write pseudocode for the following problems not c code Pseudocode only Write a C program to print all natural numbers from 1 to n. - using while loop Write a C program to print all natural numbers in reverse (from n to 1). - using while loop Write a C program to print all alphabets from a to z. - using while loop Write a C program to print all even numbers between 1 to 100. - using while loop...
C Program and pseudocode for this problem. Write a C program that plays the game of...
C Program and pseudocode for this problem. Write a C program that plays the game of "Guess the number" as the following: Your program choose the number to be guessed by selecting an integer at random in the rang of 1 to 1000. The program then asks the use to guess the number. If the player's guess is incorrect, your program should loop until the player finally gets the number right. Your program keeps telling the player "Too High" or...
write pseudocode not c program If- else programming exercises 1.    Write a C program to find...
write pseudocode not c program If- else programming exercises 1.    Write a C program to find maximum between two numbers. 2.    Write a C program to find maximum between three numbers. 3.    Write a C program to check whether a number is negative, positive or zero. 4.    Write a C program to check whether a number is divisible by 5 and 11 or not. 5.    Write a C program to check whether a number is even or odd. 6.    Write...
Write a program that calculates the salary of employees. The program should prompt the user to...
Write a program that calculates the salary of employees. The program should prompt the user to enter hourly rate and number of hours of work a day. Then, the program should display the salary daily, bi-weekly (5 days a week), and monthly. Sample program: Enter your hourly rate: >>> 20 Enter how many hours you work a day: >>> 8 Your daily salary is: $160 Your bi-weekly salary is: $1600 Your monthly: $3200
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT