Computer Science: A Structured Programming Approach Using C, Third Edition
3rd Edition
ISBN: 9780534491321
Author: Behrouz A. Forouzan, Richard F. Gilberg
Publisher: Course Technology, Inc.
expand_more
expand_more
format_list_bulleted
Question
Chapter 3, Problem 26PS
Program Plan Intro
Implementation of a
read x
read y
compute p = x * y
compute s = x + y
total = s2 + p * (s - x) * (p + y)
print total
End
Program Plan:
Write a code in C using the pseudocode given below and use all the values ​​in the floating-point types.
read x
read y
compute p = x * y
compute s = x + y
total = s2 + p * (s - x) * (p + y)
print total
End
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Using visutal studio use the given the following pseudocode, write a program that executes it. Use floating-point types for all values.
Algorithm Weekly Exercise
read x
read y
compute p = x * y
compute s = x + y
total = s2 + p * (s - x) * (p + y)
print total
end Weekly Exercise
c#
Write program that asks to enter an x numbers and sum the even numbers and odd numbers separately then print the sum?
Find the C program language
Starting My Business
by CodeChum Admin
I want to be an entrepreneur! But I don't have capital, could you help me find one? Hihi
Instructions:
Ask the user for an array of characters/string. For this program, it is guaranteed that the input of the user has one and only one capital character.
Your task is to search for that one capital character and then print it and its index.
Input
1. Inputted string
Output
Enter·a·string:·jejuMar
Capital·M·found·at·index·4
Chapter 3 Solutions
Computer Science: A Structured Programming Approach Using C, Third Edition
Ch. 3 - A unary expression consists of only one operand...Ch. 3 - The left operand in an assignment expression must...Ch. 3 - Associativity is used to determine which of...Ch. 3 - Side effect is an action that results from the...Ch. 3 - Prob. 5PSCh. 3 - Prob. 6PSCh. 3 - Prob. 7PSCh. 3 - Prob. 8PSCh. 3 - Prob. 9PSCh. 3 - Prob. 10PS
Ch. 3 - Which of the following statements about mixed...Ch. 3 - Which of the following statements about compound...Ch. 3 - Prob. 13PSCh. 3 - Prob. 14PSCh. 3 - Which of the following is not a binary expression?...Ch. 3 - Prob. 16PSCh. 3 - If originally x=4, what is the value of x after...Ch. 3 - Prob. 18PSCh. 3 - Prob. 19PSCh. 3 - What is the value of each of the following...Ch. 3 - Given the following definitions, which of the...Ch. 3 - If originally x=2,y=3,andz=2, what is the value of...Ch. 3 - Prob. 23PSCh. 3 - If x=2945, what is the value of each of the...Ch. 3 - Prob. 25PSCh. 3 - Prob. 26PSCh. 3 - Write a program that reads two integers from the...Ch. 3 - Write a program that extracts and prints the...Ch. 3 - Prob. 29PSCh. 3 - Write a program that calculates the area and...Ch. 3 - Prob. 31PSCh. 3 - Prob. 32PSCh. 3 - Write a program that changes a temperature reading...Ch. 3 - Write the C code for each of the following...Ch. 3 - Prob. 35PSCh. 3 - Write a program that converts and prints a...Ch. 3 - Prob. 37PSCh. 3 - Write a program that prompts a user for an integer...Ch. 3 - Prob. 39PS
Knowledge Booster
Similar questions
- (Numerical) Using the srand() and rand() C++ library functions, fill an array of 1000 floating-point numbers with random numbers that have been scaled to the range 1 to 100. Then determine and display the number of random numbers having values between 1 and 50 and the number having values greater than 50. What do you expect the output counts to be?arrow_forward(Statistical) In many statistical analysis programs, data values considerably outside the range of the majority of values are simply dropped from consideration. Using this information, write a C++ program that accepts up to 10 floating-point values from a user and determines and displays the average and standard deviation of the input values. All values more than four standard deviations away from the computed average are to be displayed and dropped from any further calculation, and a new average and standard deviation should be computed and displayed.arrow_forwardUsing 2019 visual studio use following pseudocode, write a program that executes it. Use floating-point types for all values. Algorithm Weekly Exercise read x read y compute p = x * y compute s = x + y total = s2 + p * (s - x) * (p + y) print total end Weekly Exercisearrow_forward
- Complete the Python function given below: def computeExp(x): #returns the value of x* + 2x - 5x² + 6arrow_forwardProgramming Language: Python 5. Write a Python function that takes a positive integer n as an argument and returns 1 if n is prime, and 0 otherwisearrow_forwardPython code Write a function that, given two integers, return the product of every integer between them, inclusive. #Example function code: #def circle_area(radius): #area = math.pi * radius ** 2 #return areaarrow_forward
- 5- Write a program to compute the most frequent numbers in vectors (x), and (y) if X= a*b y=a* c a = [13] b=[235; 478] b = [233;477]arrow_forwardC Language - Write a program that takes in three integers and outputs the largest value. If the input integers are the same, output the integers' value.arrow_forward3 Write a program to compute the sum of two matrices and then print it. Firstly user will be asked to enter the order of matrix (number of rows and columns) and then two matrices. For example if the user entered order as 2, 2 i.e. two rows and two columns and matrices as First Matrix:- 3 4 Second Matrix:- 4 5 -15 Then output of the program (sum of First and Second matrix) will be 5 7 2 9arrow_forward
- Use this table to convert digits to barcode representation and vice-versa; each digit is represented in 5 characters; so 1 will be represented as 00011; as 0 is represented as half bar (:) and 1 is a full bar (1) ; 1 will be represented as :::|| ; similarly 9 is 10100 and will be represented as |:|:: Write a program that asks the user for a ZIP code and prints the bar code. Use : for half bars, | for full bars. For example, 95014 becomes ||:|:::|:|:||::::::||:|::|:::||| Your program should also be able to carry out the opposite conversion: Translate bars into their ZIP code, reporting any errors in the input format or a mismatch of the digits. javaarrow_forwardAssume that you went for a grocery shopping where you bought several items with different quantities. Given a list of 10 items with their IDs, quantities, and unit prices, after analyzing the problem and specifying the input and output data, write an algorithm in Pseudocode that performs as follows:• prompt the user to enter the list of items,• compute the total price of each item, and• compute the total price of all the items, including the sale taxes. ....answer should specify the input and output data, and the algorithm in Pseudocodearrow_forwardHomework-1-Q 2021.pdf 4 من 5 Al-Farabi University College Computer Programming Methodology Department of Computer Engineering Dr. Hussein Muzahim Aziz Basi ylallt First Year 2020-2021 AL-FA RABI UNIVERS TY COLLIG Homework 3: Write a program to calculate two real numbers. The operation you are going to used are "add, subtract, multiple and division" and it is going to be optional to calculate the two numbers separately at each time you are going to execute the program, After you execute the program separately at each time your run the program the output look like below: • to add betveen tuo nunbers - to subtract bet veen tuo nunhers * to nultiply betveen tuo nunbera - to diu ide hetveen tuo nunbers Enter Enter Enter Enter Enter the operation i+ Enter the Ist nunher :2.3 Enter the 2nd nunber :5.6 The result is 7.980 Press any ke y to continue . • -- OR Enter Enter Enter Enter to add betveen tuo nunbers - to subtract betueen tuo nunbers - to nultiply betueen tuo nunbere to divide betueen…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning