Programming in C
4th Edition
ISBN: 9780321776419
Author: Stephen G. Kochan
Publisher: Addison-Wesley
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 2, Problem 2E
Write a
- 1. In C, lowercase letters are significant.
- 2. m is where program execution begins.
- 3. Opening and closing braces enclose program statements in a routine.
- 4. All program statements must be terminated by a semicolon.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
1. Write the algorithm and draw the flow chart for a program that calculates and displays a person’s body mass index (BMI). The BMI is often used to determine whether a person with a sedentary lifestyle is overweight or underweight for his or her height. A person’s BMI is calculated with the following formula:
BMI = weight × 703 / height2 Where weight is measured in pounds and height is measured in inches. The program should display a message indicating whether the person has optimal weight, is underweight, or is overweight. A sedentary person s weight is considered to be optimal if his or her BMI is between 18.5 and 25. If the BMI is less than 18.5, the person is considered to be underweight. If the BMI value is greater than 25, the person is considered to be overweight.
2. Draw a flowchart that shows how to evaluate the following expression, given that A = 1 and B = 3. Your answer should be either be true or false. (A + 5) ^2 − (B + 4 * A)
vi) In C# programming language, create a program to take input three integers x, y, and z and print their product in the output.
After a certain point, the usage of an initial block statement becomes invalid.
Chapter 2 Solutions
Programming in C
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
What three steps must be taken when a file is used by a program?
Starting Out with C++ from Control Structures to Objects (8th Edition)
Fill in the blanks in each of the following statements: A relation that has no partial functional dependencies ...
Modern Database Management
Before GUIs became popular, the _____ interface was the most commonly used. a. command line b. remote terminal ...
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
Use the alternatives forms x(t)=N(x0H)+H(Nx0)ek(NH)t(x0H)+(Nx0)ek(NH)t=H(Nx0)ek(NH)tN(Hx0)(Nx0)ek(NH)tN(Hx0) of...
Differential Equations: Computing and Modeling (5th Edition), Edwards, Penney & Calvis
3.12 (Date Create a class called Date that includes three pieces Of information as data
members—a month (type ...
C++ How to Program (10th Edition)
Indicate whether data administration or database administration is typically responsible for each of the follow...
Modern Database Management (12th Edition)
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
- 25. Repeat Programming Exercise 24, but the wire is to be bent in the form of a circle. In this case, the user specifies the length of the wire and the program outputs the radius and area of the circle. (You may assume that . Also declare it as a named constant.)arrow_forward(Data processing) Years that are evenly divisible by 400 or are evenly divisible by 4 but not by 100 are leap years. For example, because 1600 is evenly divisible by 400, 1600 was a leap year. Similarly, because 1988 is evenly divisible by 4 but not by 100, it was also a leap year. Using this information, write a C++ program that accepts the year as user input, determines whether the year is a leap year, and displays a message telling the user whether the entered year is or is not a leap year.arrow_forwardUniversity of Babylon College of Information Technology Department of Information Security Programing Fundamentals C++, First Stage Assignment (2) / Due Date March 1,2021: 12pm Q1. Write a program to read one mark of a student from keyboard and check whether the student is pass or fail, then print "pass" if the mark is greater than or equal to 50 and print "fail" if the mark is less than 50. Q2. Write a program to read three numbers from keyboard and find out the maximum out of these three numbers (using nested if-else). Q3. Write a program to read marks from keyboard display equivalent grade cording to the following table. (using if-else if leader). Iyour program should Grade Distinction Marks 100 - 80 60 - 79 First Class 35 - 59 Second Class 0- 34 Fail Q4. Write a program to read a number in the range from 1 to 7 and accordingly it should display MONDAY to SUNDAY (using if-else-if leader). Q5. Write a program to read number for keyboard and check whether the given number is positive,…arrow_forward
- A and BonlyIn this program, you are asked to write a program in assembly which works as a simple calculator.The program will get two integer numbers, and based on the requested operation, the result shouldbe shown to the user.a. The program should print a meaningful phrase for each input, and the result.i. “Enter the first number”ii. “Enter the second number”iii. “Enter the operation type”iv. “The result is”b. The user should enter 0, 1, and 2 to tell the program the types of operation add, sub, andmultiply, respectively.c. How many registers do you need to implement this program?d. What system calls do you need to write this program?arrow_forwardDescription Write a medium C program that lets you input five(5) numbers. Create five options for the user which are the ff.: 1. Add the 1st, 2nd, and 5th variables. 2. Multiply 3rd, 4rth, and 5th variables. 3. Subtract the fifth variable from the 3rd variable. 4. Divide the 3rd variable by the 1st variable. 5. Perform all operations abovementioned.arrow_forwardQ1. Solve problem using 5-steps of Engineering Problem Solving Methodology (including algorithm) Q2. Draw flowchart diagram Q3. Write c++ program Problem Statement:An election is a formal group decision-making process by which a population chooses a candidate by castingvotes. Each candidate is assigned name and a specific symbol. A ballot paper is used to cast the vote. Eachballot paper contains symbols of the candidate. A person can vote a candidate by stamping on a specific symbol.The ballot paper should be considered as a spoilt ballot if a person does not stamp or stamp on more than onesymbol. Finally ballot paper has to be dropped in a ballot box.Write a C++ program that reads the information from the user to enter the name of the candidate, the totalnumber of received votes, and the spoilt votes in a local election. The total number of participants (candidates)are 5. If the user mistakenly enters any negative value, the program should consider that value as a positiveinteger.…arrow_forward
- If an initial block statement is used after a certain point, it will become invalid.arrow_forwardDealing With Months by CodeChum Admin We're done dealing with days. It's time to step up and now deal with months! Instructions: 1. In the code editor, you are provided with a code in the main() which has 12 cout's. Each cout prints a month with its corresponding value. For this program, January is 1, February is 2, March is 3, and so on. When you run the initial code, you will encounter errors because these month names that have been printed don't exist yet. 2. Your task is to create an enum data type which contains these month names as values so that when we run the code, there will be no more error. 3. Do not edit anything in the main(). Output January.= 1 February = 2 March:= 3 April-=-4 May--5 June:=-6 July =-7 August.=-8 September ·=-9 October:= 10 November.=11 December.= 12arrow_forwardPROGRAM 6: Three Zero GameWrite an HLA program that reads a number. Then by subtracting off a three and tens, determine if that value ends in a zero or a three. Three such numbers in a row wins the game! Shown below are sample program dialogues to help you build your program. Gimme a number: 20It ends in zero!Keep going...Gimme a number: 53It ends in three!Keep going...Gimme a number: 41Sorry Charlie! You lose the game!Gimme a number: 50It ends in zero!Keep going...Gimme a number: 23It ends in three!Keep going...Gimme a number: 70It ends in zero!You Win The Game! Gimme a number: 51Sorry Charlie! You lose The Game!arrow_forward
- # Write a detailed description of what this program does. The write-up should include: # 1) A single sentence that summarizes what the entire program is doing as a whole. That is, you should be able to state what the entire program is doing using one sentence. # 2) A detailed walkthrough explaining how exactly the program accomplishes the end goal from (1). Make sure this part of the write-up has a high degree of specificity. import math x1 = int (input ("x1: ")) yl = int (input ("yl: ")) x2 = int (input ("x2: ")) y2 = int (input ("y2: ")) 5 xT = x1 + x2 a yT = 3 rT = math.sqrt( yT**2 + xT**2 ) 9 zT = math.atan2( yT, xT ) (180 / math.pi) yl + y2 1 print (str(rT) +" e "+ str(zT))arrow_forward###Python Program-related question. So need the answer in python expressions. COSC 1336 – Programming Fundamentals I Program 3 – Arithmetic Expressions A county collects property taxes on the assessed value of property, which is 60 percent of its actual value. For example, if a house is valued at $158,000.00 its assessed value is $94,800. This is the amount the homeowner pays tax on. If the tax rate is $2.64 for each $100.00 of assessed value, the annual property tax for this house would be$2502.72. Write a program that asks the user for the actual value of a piece of property and the current tax rate for each $100.00 of assessed value. The program should then calculate and display how much annual property tax the homeowner will be charged for his property. Run your program three times with the data below and copy and paste the outputs to afile. Create a folder named, fullname_program3. Copy your source code and the output file to the folder. Property Value: Tax Rate$100,000.00…arrow_forwardpython solution please Task 1Description let's consider a case when you need a lot of coffee. Maybe you're hosting a party with a lot of guests! In these circumstances, it's better to make preparations in advance.So, we will ask a user to enter the desired amount of coffee, in cups. Given this, you can adjust the program by calculating how much water, coffee, and milk are necessary to make the specified amount of coffee.Of course, all this coffee is not needed right now, so at this stage, the coffee machine doesn't actually make any coffee yet. ObjectivesLet's break the task into several steps:First, read the numbers of coffee drinks from the input.Figure out how much of each ingredient the machine will need. Note that one cup of coffee made on this coffee machine contains 200 ml of water, 50 ml of milk, and 15 g of coffee beans.Output the required ingredient amounts back to the user. ExamplesThe greater-than symbol followed by space (> ) represents the user input. Notice that…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Introduction to Operators in C; Author: Neso Academy;https://www.youtube.com/watch?v=50Pb27JoUrw;License: Standard YouTube License, CC-BY