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
Concept explainers
Textbook Question
Chapter 2, Problem 13PS
One of the most common errors for new programmers is forgetting to use the address operator for variables in a scanf statement. What is the address operator?
a. The address modifier
b. The ampersand
c. The caret
d. The percent
e. The pound sign
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
void change( int a[]) , the compiler converts the parameter to:
Select one:
a.
int *const a
b.
int &a;
c.
int a
d.
const int a; c++
help me with this!! in basic c language please.
Lab #3 – Day CalculationBackground - Many times one needs to do calculations on dates. Programs like Excel use the number of days since 1/1/1970 when doing these calculations. We don't know enough C++ to completely do this calculation, yet, but we can make a start.Problem - You will prompt a user for a month, a day and a year. You will then tell the user how many days since January 1 of that year the input date is.For example if the user inputs a 3 for the month, a 2 for the day, and 2000 for the year the program outputs the number of days as being 62. Note 2000 is a leap year. Therefore you must test to see if a year is a leap year when doing this problem.The three rules which the Gregorian calendar uses to determine leap year are as follows:1. Years divisible by four are leap years, unless...2. Years also divisible by 100 are not leap years, except...**3. Years divisible by 400 are leap years. **** Combining rules 2 & 3: Centennial years that are not divisible by 400 are not leap…
Chapter 2 Solutions
Computer Science: A Structured Programming Approach Using C, Third Edition
Ch. 2 - The purpose of a header file, such as stdio.h, is...Ch. 2 - Prob. 2PSCh. 2 - The C standard function that receives data from...Ch. 2 - Which of the following statements about the...Ch. 2 - Which of the following statements about block...Ch. 2 - Prob. 6PSCh. 2 - Which of the following is not a data type?...Ch. 2 - The code that establishes the original value for a...Ch. 2 - Prob. 9PSCh. 2 - Prob. 10PS
Ch. 2 - To print data left justified, you would use a in...Ch. 2 - Prob. 12PSCh. 2 - One of the most common errors for new programmers...Ch. 2 - Which of the following is not a character constant...Ch. 2 - Which of the following is not an integer constant...Ch. 2 - Which of the following is not a floating-point...Ch. 2 - Prob. 17PSCh. 2 - Which of the following is not a valid identifier...Ch. 2 - What is the type of each of the following...Ch. 2 - What is the type of each of the following...Ch. 2 - Which of the following identifiers are valid and...Ch. 2 - Which of the following identifiers are valid and...Ch. 2 - What is output from the following program...Ch. 2 - Prob. 24PSCh. 2 - Find any errors in the following program....Ch. 2 - Find any errors in the following program....Ch. 2 - Prob. 27PSCh. 2 - Prob. 28PSCh. 2 - Prob. 29PSCh. 2 - Code the variable declarations for each of the...Ch. 2 - Code the variable declarations for each of the...Ch. 2 - Write a statement to print the following line....Ch. 2 - Write a program that uses four print statements to...Ch. 2 - Write a program that uses four print statements to...Ch. 2 - Write a program that uses defined constants for...Ch. 2 - Prob. 36PSCh. 2 - Prob. 37PSCh. 2 - Write a program that prompts the user to enter an...Ch. 2 - Write a C program using printf statements to print...Ch. 2 - Write a program that reads a character, an...Ch. 2 - Write a program that prompts the user to enter...Ch. 2 - Write a program that reads 10 integers and prints...Ch. 2 - Write a program that reads nine integers and...
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
- c++ programming i dont know how to answer this but.. The output really should be like on the photo Please helparrow_forwardIn this chapter, you learned that although a double and a decimal both hold floating-point numbers, a double can hold a larger value. Write a C# program named DoubleDecimalTest that declares and displays two variables-a double and a decimal. Experiment by assigning the same constant value to each variable so that the assignment to the double is legal but the assignment to the decimal is not. In other words, when you leave the decimal assignment statement in the program, an error message should be generated that indicates the value is outside the range of the type decimal, but when you comment out the decimal assignment and its output statement, the program should compile correctly.arrow_forwardAssignment #2 Instructions: Through this programming assignment, the students will learn to do the following: Learn to work with command line options and arguments Gain more experience with Makefiles Gain more experience with Unix Learn to use some of the available math functions available with C Usage: mortgagepmt [-s] -r rate [-d downpayment] price In this assignment, you are asked to perform a mortgage payment calculation. All information needed for this will be passed to the program on the command line. There will be no user input during the execution of the program You will need a few pieces of information. The price of the home and the amount of the down payment. You will also need to know the interest rate and the term of the mortgage. To figure your mortgage payment, start by converting your annual interest rate to a monthly interest rate by dividing by 12. Next, add 1 to the monthly rate. Third, multiply the number of years in the term of the mortgage by 12 to calculate the…arrow_forward
- Based on the output, create a C++ program that will consider the variables as your declaration statements. Have the program use the address operator and the cout object to display the addresses corresponding to each variable. INTERPRET YOUR PROGRAM.arrow_forwardLanguage : C++arrow_forwardIn C programming language, if the first and the second operands of operator + are of types int and float, respectively, the result will be of type A. int B. float C. char D. long intarrow_forward
- Write a C++ program that helps calculate how long it would take a user to pay off a loan with compound interest. You should prompt the user for the principle amount, how much interest is being charged, and how much they are able to pay back each month. You should assume that all amounts are in dollars and cents, that interest is charged monthly, and that payments are also made monthly. The program should display a table with the following columns: the month number, the amount remaining on the loan, and the total amount already paid. For *each* row, you should: 1. *FIRST* subtract the payment from the amount remaining on the loan.2. *THEN* add interest based on this new total amount. You should continue to print out rows in the table until either the amount remaining is <= $0 or if 100 months have passed. Then, print out a summary showing the number of months that will elapse and how much total has been paid. If the table stops at 100 months, print out a message telling the user that…arrow_forwardPlease answer: You are tasked to create a program on C++ that will enable the user to input first name, middle initial, and last name all in upper cases. with a 22-character limit that also includes spaces in between the names on the ID card. The following limitations should be included in the program:1.) If the first name, second name, middle initial, and last name exceed the character limit, use the first name initial and last name. 2.) If the last name’s character count is greater than or equal to the character limit, omit the second name and middle initial. Use the first name initial and truncate the last name to fit the character limit. 3.) The spaces in between the first name, second name, middle initial, and last name should not be included in the input. 4.) If there is no second name or middle initial, input 0. OUTOUT PROGRAM SHOULD BE: Type First Name: Type Second Name: Type Middle Name: Type Last Name: Result:arrow_forwardIntro to Python Programming:arrow_forward
- Needs to be done in C# language. Problem Write a program that computes and displays the charges for a patient’s hospital stay. First, the program should ask if the patient was admitted as an in-patient or an out-patient. If the patient was an in-patient, the following data should be entered: • The number of days spent in the hospital• The daily rate• Hospital medication charges• Charges for hospital services (lab tests, etc.) The program should ask for the following data if the patient was an out-patient: • Charges for hospital services (lab tests, etc.)• Hospital medication charges The program should use two overloaded functions to calculate the total charges. One of the functions should accept arguments for the in-patient data, while the other function accepts arguments for out-patient information. Both functions should return the total charges. Input Validation: Do not accept negative numbers for any data.arrow_forwardC++ Programming It should align exactly like the screenshot, sample output. The local Driver’s License Office has asked you to write a program that grades the written portion of the driver’s license exam. The exam has 20 multiple choice questions. Here are the correct answers: 1. A2. D3. B4. B5. C6. B7. A8. B9. C10.D11. A12. C13. D14. B15. D16. C17. C18. A19. D20. B Your program should store the correct answers shown above in an array. It should ask the user to enter the student’s answers for each of the 20 questions, and the answers should be stored in another array. After the student’s answers have been entered, the program should display a message indicating whether the student passed or failed the exam. (A student must correctly answer 15 of the 20 questions to pass the exam.) It should then display the total number of correctly answered questions, the total number of incorrectly answered questions, and a list showing the question numbers of the incorrectly answered questions.…arrow_forwardInstruction: Hello, please write this program in C#. I have attached a document about the format I need you to use when writing the code in C#. Please let me know if there are any problems. Thank you Question: You are tasked with writing a program to process students’ end-of-semester marks. For each student, you must enter into your program the student’s id number (an integer), followed by their mark (an integer out of 100) in 4 courses. A student number of 0 indicates the end of the data. A student moves on to the next semester if the average of their 4 courses is at least 60 (greater than or equal to 60). Write a program to read the data and print, it for each student: The student number, the marks obtained in each course, final mark of the student (average of all the marks), their final grade (A, B, C, D, or F), and whether or not they move on to the next semester. In addition, after all, data entry is completed, print The number of students who move on to the next semester and…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 LearningMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Introduction to Operators in C; Author: Neso Academy;https://www.youtube.com/watch?v=50Pb27JoUrw;License: Standard YouTube License, CC-BY