Starting Out with C++ from Control Structures to Objects (8th Edition)
8th Edition
ISBN: 9780133769395
Author: Tony Gaddis
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 3.9, Problem 3.23CP
The cosecant of the angle a is
Write a statement that calculates the cosecant of the angle stored in the variable a, and stores it in the variable y.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
3. A car's miles-per-gallon (MPG) can be calculated with the following formula:
MPG = Miles driven / Gallons of gas used
Write a program that asks the user for the number of miles driven and the gallons of gas used. It
should calculate the car's miles-per-gallon and display the result on the screen.
When using a printf() statement, what syntax do you use to print the value of a
"double"?
%d
%s
%f
%c
A car’s miles-per-gallon (MPG) can be calculated with the following formula:MPG 5 Miles driven Gallons of gas usedWrite a program that asks the user for the number of miles driven and the gallons of gas used. It should calculate the car’s MPG and display the result.
Chapter 3 Solutions
Starting Out with C++ from Control Structures to Objects (8th Edition)
Ch. 3.1 - Prob. 3.1CPCh. 3.1 - Prob. 3.2CPCh. 3.1 - Assume value is an integer variable. If the user...Ch. 3.1 - A program has the following variable definitions....Ch. 3.1 - Prob. 3.5CPCh. 3.1 - Complete the following program skeleton so it asks...Ch. 3.2 - Complete the table below by determining the value...Ch. 3.2 - Write C++ expressions for the following algebraic...Ch. 3.2 - Prob. 3.9CPCh. 3.2 - Complete the following program skeleton so it...
Ch. 3.5 - Assume the following variable definitions: int a =...Ch. 3.5 - Complete the following program skeleton so it asks...Ch. 3.5 - Prob. 3.13CPCh. 3.6 - Write a multiple assignment statement that assigns...Ch. 3.6 - Write statements using combined assignment...Ch. 3.6 - Prob. 3.16CPCh. 3.7 - Write cout statements with stream manipulators...Ch. 3.7 - Prob. 3.18CPCh. 3.7 - The following program skeleton asks for an angle...Ch. 3.9 - Prob. 3.20CPCh. 3.9 - Assume the variables angle1 and angle2 hold angles...Ch. 3.9 - To find the cube root (the third root) of a...Ch. 3.9 - The cosecant of the angle a is 1sina Write a...Ch. 3 - Assume the following variables are defined: int...Ch. 3 - Prob. 2RQECh. 3 - Prob. 3RQECh. 3 - Complete the following table by determining the...Ch. 3 - Write C++ expressions for the following algebraic...Ch. 3 - Assume a program has the following variable...Ch. 3 - Assume a program has the following variable...Ch. 3 - Assume qty and salesReps are both integers. Use a...Ch. 3 - Rewrite the following variable definition so that...Ch. 3 - Complete the following table by providing...Ch. 3 - Write a multiple assignment statement that can be...Ch. 3 - Write a cout statement so the variable divSales is...Ch. 3 - Write a cout statement so the variable totalAge is...Ch. 3 - Prob. 14RQECh. 3 - The__________ library function returns the cosine...Ch. 3 - The ___________ library function returns the sine...Ch. 3 - The ________ library function returns the tangent...Ch. 3 - The __________ library function returns the...Ch. 3 - The _________ library functionreturns the...Ch. 3 - The _________ library function returns the natural...Ch. 3 - Prob. 21RQECh. 3 - The _______ library function returns the value of...Ch. 3 - The _________ libraryfunction returns the square...Ch. 3 - The ________ file must beincluded in aprogramthat...Ch. 3 - A retail store grants its customers a maximum...Ch. 3 - Write a pseudocode algorithm for a program that...Ch. 3 - Write a pseudocode algorithm for a program that...Ch. 3 - using namespace std; int main () { double number1,...Ch. 3 - #include iostream using namespace std; int main()...Ch. 3 - #include iostream; using namespace std; int main()...Ch. 3 - #include iostream; using namespace std; main { int...Ch. 3 - #inc1ude iostream; using namespace std; main {...Ch. 3 - #inc1ude iostream; using namespace std; int main()...Ch. 3 - What will each of the following programs display?...Ch. 3 - #include iostream using namespace std; int main()...Ch. 3 - (Assume the user enters George Washington.)...Ch. 3 - (Assume the user enters 36720152. Use a...Ch. 3 - Miles per Gallon Write a program that calculates a...Ch. 3 - Stadium Seating There are three seating categories...Ch. 3 - Test Average Write a program that asks for five...Ch. 3 - Average Rainfall Write a program that calculates...Ch. 3 - Ingredient Adjuster A cookie recipe calls for the...Ch. 3 - Box Office A movie theater only keeps a percentage...Ch. 3 - How Many Widgets? The Yukon Widget Company...Ch. 3 - How Many Calories? A bag of cookies holds 30...Ch. 3 - How Much Insurance? Many financial experts advise...Ch. 3 - Automobile Costs Write a program that asks the...Ch. 3 - Celsius to Fahrenheit Write a program that...Ch. 3 - Currency Write a program that will convert U.S....Ch. 3 - Monthly Sales Tax A retail company must file a...Ch. 3 - Property Tax A county collects property taxes on...Ch. 3 - Senior Citizen Property Tax Madison County...Ch. 3 - Math Tutor Write a program that can be used as a...Ch. 3 - Interest Earned Assuming there are no deposits...Ch. 3 - Monthly Payments The monthly payment on a loan may...Ch. 3 - Pizza Pi Joes Pizza Palace needs a program to...Ch. 3 - Angle Calculator Write a program that asks the...Ch. 3 - Stock Transaction Program Last month Joe purchased...Ch. 3 - Word Game Write a program that plays a word game...
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
- (Physics) Coulomb’s Law states that the force, F, acting between two electrically charged spheres is given by this formula: F=kq1q2r2 q1isthechargeonthefirstsphere.q2isthechargeonthesecondsphere.risthedistancebetweenthecentersofthetwospheres.kisaproportionalityconstant. Write an assignment statement to calculate the force, F.arrow_forward(Misc. application) a. Write a program to reverse the digits of a positive integer number. For example, if the number 8735 is entered, the number displayed should be 5378. (Hint: Use a do statement and continuously strip off and display the number’s units digit. If the variable numinitially contains the number entered, the units digit is obtained as (num % 10). After a units digit is displayed, dividing the number by 10 sets up the number for the next iteration. Therefore, (873510)is5and(8735/10)is873. The do statement should continue as long as the remaining number is not 0.) b. Run the program written in Exercise 3a and verify the program by using appropriate test data.arrow_forwardQ3: Statement use to evaluate the value of (n sin 30°) PI*sin(30)/180 PI*sin(30*PI)/180 PI*sin(30) Pl*sin(30*PI/180) Other:arrow_forward
- Computer Fundamentals and Programming 2 Write a program that determines a student’s grade. The program will accept 3 scores and computes the average score. Determine the grade based on the following rules: - If the average score is equal or greater than 90, the grade is A. - If the average score is greater than or equal to 70 and less than 90, the grade is B. - If the average score is greater than or equal to 50 and less than 70, the grade is C. - If the average score is less than 50, the grade is F. Source Codes and Print Screen of the Outputarrow_forward4. Calculate employee's pay A program is required by a company to read an employee's number, pay rate and the number of hours worked in a week. The program is then to validate the pay rate field and the hours worked field and, if valid, compute the employee's weekly pay and then print it and the input data. Validation: According to the company's rules, the maximum hours an employee can work per week is 60 hours, and the maximum hourly rate is $25.00 per hour. If the hours worked field or the hourly rate field is out of range, the input data and an appropriate message are to be printed and the employee's weekly pay is not to be calculated. Weekly pay calculation: Weekly pay is calculated as hours worked times pay rate. If more than 35 hours are worked, payment for the overtime hours worked is calculated at time-and-a-half.arrow_forwardchoose the correct answerarrow_forward
- Input Forming----8.arrow_forwardne nouncements 2. Days of the Week odules • Write a program that asks the user for a number in the range of 1 through 7. The program should display the corresponding day of the week, where 1- Monday, 2 - Tuesday and so forth. If the user types in a 6 then "Saturday" should be printed on the screen. For help with Input statements see: Input Function izzes • The program should print an error message if the user enters a number that is outside the range of 1 through 7. For help with If statements and conditions see the following pages: If-Else Statements and Operators. • Name the source code file yourName_HW4 1.py. • Test and run the program. Capture the output console and save it as an image file named yourName_HW3_output4_1.jpg. • Submit the py and the image files through Canvas. rades yllabus Zoom Library Research Guides 3. Roman Numerals • Write a program that displays the Roman numeral version of a decimal number entered. The program should prompt the user to enter a number from 1 to…arrow_forwardPraticing Write a flowgorithm program that will calculate a person’s mobile phone bill based on plan chosen and the data used. The program should perform the following: Ask for customer’s mobile plan Ask for the number of gigabytes of data used Display an error message if the plan choice is invalid or the gigabytes used is less than zero (0) Mobile data plans are: Plan A 19.99/month, with 4 gigabytes data, additional data $10/gigabyte Plan B 29.99/month, with 8 gigabytes data, additional data $5/gigabyte Plan C 39.99/month, unlimited data Remember the following: use clear prompts for your input label each output number or name (Comment: I need help practicing with Flowgorithm, I don't understand the concept of flowgorithm, and I need the practice to help me understand computer science better. Please help me, thank you).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 PtrEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTC++ 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
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Expressions in C++ | C++ tutorial for beginners; Author: Tutorial Mart;https://www.youtube.com/watch?v=XHbsZGpmRc8;License: Standard YouTube License, CC-BY
expression in python # python expressions; Author: Abhishek Tripathi;https://www.youtube.com/watch?v=Cc-kJGRjH6k;License: Standard Youtube License