C How to Program (8th Edition)
8th Edition
ISBN: 9780133976892
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 14, Problem 14.8E
Program Plan Intro
- The variable i of type int is used in the outer while loop.
- The variable j of type int is used in the inner while loop.
- goto is used to jump the block.
- A while loop is used to print the square of asterisks patten.
Program description:
The main purpose of the program is to prints the square of asterisks using a goto statement.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Factorial) The factorial of a nonnegative integer n is written n! (pronounced “n factorial”) and is defined as follows:For example, 5!= 5.4.3.2.1 , which is 120. Use while statements in each of the following:A. Write a program that reads a nonnegative integer and computes and prints its factorial.B. Write a program that estimates the value of the mathematical constant e by using the formula:Prompt the user for the desired accuracy of e (i.e., the number of terms in the summation).C. Write a program that computes the value of by using the formula Prompt the user for the desired accuracy of e (i.e., thenumber of terms in the summation).
Q7-Write a program that simulates a simple calculator. It reads two integers and
a character. If the character is a +, the sum is printed; if it is a -, the difference is
printed; if it is a *, the product is printed; if it is a /, the quotient is printed; and
if it is a %, the remainder is printed. (Use a switch statement.)
Student Grade Generator (Toy Problem)
Write that prompts the user to input student marks. The input should be between 0 and 100. Then output the correct grade:
A > 79, B - 60 to 79, C - 59 to 49, D - 40 to 49, E - less 40.
Chapter 14 Solutions
C How to Program (8th Edition)
Ch. 14 - (Variable-Length Argument List: Calculating...Ch. 14 - (Printing Command-Line Arguments) Write a program...Ch. 14 - Prob. 14.4ECh. 14 - (Signal Handling) Read the documentation for your...Ch. 14 - (Dynamic Array Allocation) Write a program that...Ch. 14 - (Command-Line Arguments) Write a program that...Ch. 14 - Prob. 14.8E
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- case study : calculate future value ** using basic python and sublime write a program that prompts the user for a monthly investment amount, a yearly interest rate, and a number of years; them calculate the future value of the investments using a monthly interest calculation the program should loop with a prompt to the order for new input until they choose to exit (this should be your outer loop) beginner python, needs to calculate future value properly.arrow_forward5) Analyze the following code: boolean even = ((240 % 2) = 0): if (even) System.out.println("It is even!"): a. The program has a syntax error b. The program has a runtime error c. The program displays “It is odd!" d. d. The program displays "It is even!" else Page 2 of 6 System.out.println("It is odd!");arrow_forwardQ4) Write program, to allow the user to enter the height, and width of any rectangle, and find the area. area= height*width Q5) ) Write program , to allow the user to enter the height, and base of any triangle, the find the area. Q6) Write program, to allow the user to enter the radius of any circle, and find the area of this circle. Note : area= pi*(n*n)arrow_forward
- 1. Find the error in each of the following code segments and explain how to correct it. a) x = 1; while (x 1; y++) printf("%c\n", y);arrow_forward(DEBUG AND MAKE A FLOWCHART OF THIS PROGRAM) // This pseudocode is intended to display// employee net pay values. All employees have a standard// $45 deduction from their checks.// If an employee does not earn enough to cover the deduction,// an error message is displayed.// This example is modularized.start Declarations string name string EOFNAME = ZZZZ while name not equal to EOFNAME housekeeping() endwhile while name not equal to EOFNAME mainLoop() endwhile while name not equal to EOFNAME finish() endwhilestop housekeeping() output "Enter first name or ", EOFNAME, " to quit "return mainLoop() Declarations num hours num rate num DEDUCTION = 45 num net output "Enter hours worked for ", name input hours output "Enter hourly rate for ", name input rate gross = hours * rate net = gross - DEDUCTION if net > 0 then output "Net pay for ", name, " is ", net else output "Deductions not covered. Net is…arrow_forwardPlease answer item number 4. (pyhthon programming)arrow_forward
- Q6) Write a program that calculates the factorial of a positive integer, factorial of zero is one. If the user entered a negative number, the program should print an error message and ask the user to reinter the number. After displaying the result, the program should ask the user if he wishes to calculate the factorial of another number or he wants to terminate the program?arrow_forwardParking Charges) A parking garage charges a $2.00 minimum fee to park for up to threehours and an additional $0.50 per hour for each hour or part thereof over three hours. The maximumcharge for any given 24-hour period is $10.00. Assume that no car parks for longer than 24 hoursat a time. Write a program that will calculate and print the parking charges for each of three customers who parked their cars in this garage yesterday. You should enter the hours parked for eachcustomer. Your program should print the results in a tabular format, and should calculate and printthe total of yesterday's receipts. The program should use the function calculateCharges to determine the charge for each customer. Your outputs should appear in the following format:Car Hours Charge1 1.5 2.002 4.0 2.503 24.0 10.00TOTAL 29.5 14.50arrow_forwardcommas.cpp) Write a program that accepts a 7-9) digit//integer and echoes the number with commas between every//three digits from the right. Test it with the numbers//, 20300045, & 10000000 c++ // program inserts comas into number given #include <iostream>using namespace std;int main(){int leadingDigits,middledigits,lastdigits;int tempValue,original;cout<< "please enter a 7-9 digit number.\n";cin>>original;tempValue=original/1000;lastdigits=original%1000; // add code lastdigits=original%100; // corrected codeleadingDigits=tempValue/1000;middledigits=tempValue%1000; // add code middledigits=tempValue%100; // corrected code cout<<"the number with comas is "<<leadingDigits;cout<< ","<<middledigits/1<< "," <<lastdigits/1<<endl; // correct this to print individual digits of middle and last digitsreturn 0;}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 PtrMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Literals in Java Programming; Author: Sudhakar Atchala;https://www.youtube.com/watch?v=PuEU4S4B7JQ;License: Standard YouTube License, CC-BY
Type of literals in Python | Python Tutorial -6; Author: Lovejot Bhardwaj;https://www.youtube.com/watch?v=bwer3E9hj8Q;License: Standard Youtube License