Concept explainers
Explanation of Solution
Given: The flowchart of the code fragment concerning figure 5-29, where the integer variables, x and y, and a float variable z are declared.
To find: The code fragment for the flowchart concerning figure 5-29, where the integer variables, x and y, and a float variable z are declared.
Solution:
In this code, the variables such as x as int, y as int, and z as float are declared. The code allows the user to enter the values for x and y to satisfy the if-else statement where the conditions determine the code is fragmented. It evaluates and determines the values of x, y, and z.
The code will appear as:
//a header file included for using functions such as
//printf and scanf
#include
//Declaring variables.
int main() {
//declaration of a variable named “x� as int
int x;
//declaration of a variable named “y� as int
int y;
//declaration of a variable named “z� as float
float z;
// let the user enter values of x and y...
Want to see the full answer?
Check out a sample textbook solutionChapter 5 Solutions
Computer Science: A Structured Programming Approach Using C, Third Edition
- Create a flowchart for the following:arrow_forwardCREATE A FLOWCHART FOR THIS CODE ASAP THANK YOUarrow_forwardA. Draw a flowchart that will request the user to input Point A, Point B, Speed of Train (km/h) and then display how long it takes for a train to reach its destination. B. Write a pseudocode that will request the user to input his/her name, then displays his/her name afterwards.arrow_forward
- Create a flowchart using Flowgorithm and Pseudocode for the following program example: You are to design a program for Alexander's Coffee Shop providing customer research data. When a customer places an order, the clerk asks the customer for their zip code and age. The clerk enters this data as well as the number of items purchased. The program should operate continuously until the clerk enters a 0 for the zip code at the end of the day. If the clerk enters an invalid age (defined as less than 10 or more than 100), an error message is displayed and the program re-prompts the clerk continuously to enter a valid age. At the end of the program, display the average customer age and the total number of items purchased.arrow_forwardCreate a flowchart and pseudocode based on the code below:arrow_forwardDraw a flowchart that will display the first n Fibonacci series.arrow_forward
- Draw a flowchart and write pseudocode for each of the following scenarios for the ABC College:a. The current annual matriculation fee is $12,000.00 and it is expected to increase by 5% each year. Show the matriculation fee for the next 10 years.b. Revise (a) so that the user can enter the rate of increase, instead of having it set at 5%.c. Revise (a) so that the user enters the rate of increase for the first year and it then increases by 0.3% each subsequent year.arrow_forwardUsing a flow chart display a series of numbers in which each number (Fibonacci Number)is the sum of the two preceding numbers.Display the ff. sequence of number. 1, 1, 2, 3, 5, 8. *USE FLOWGORITHMarrow_forwardDraw a flowchart that will print numbers from 1 to 8 and get the sum of these 8numbers.arrow_forward
- 4. Design a floating point ALU for multiplication and division. Also draw the flowcharts. Please do it clearly, correctly and show each step properly.arrow_forwardDraw the flowchart for an application that can calculate the Least Common Multiple (LCM) of two numbers. The application can only accept a number from 1-20 only.arrow_forwardI need only Draw the flowchart Fast pleasearrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education