Starting Out with C++ from Control Structures to Objects (9th Edition)
9th Edition
ISBN: 9780134498379
Author: Tony Gaddis
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 3, Problem 29RQE
#include <iostream>
using namespace std;
int main()
{
int number1, number2;
float quotient;
cout << “Enter two numbers and I will divide\n”;
cout << “the first by the second for you.\n”;
cin >> number1, number2;
quotient = float<static_cast>(number1) / number2;
cout << quotient
return 0;
}
Expert Solution & Answer
Learn your wayIncludes step-by-step video
schedule06:16
Students have asked these similar questions
C++ console application that will display the quotient of 10 numbers
in c language
typedef _people {
int age;
char name[ 32 ] ;
} People_T ;
People_T data [ 3 ];
Using string lib function, Assign 30 and Cathy to the first cell, Assign 40 and John to the second cell and Assign 50 and Tom to the third cell
QUESTION 21
int x1=200;
int y1=3003;
int z1, z2, z3, z4;
int d1, d2, d3;
_asm{
mov EAX, x1; 200
mov EBX, y1; 300
mov z1, ESP; assume initial ESP: OFFF FFEA
add EAX, x1; 400
push EAX;
mov d1, EAX:400
mov z2, ESP;
push EBX;
SUB EBX, x1; 300-200=100
mov d2, EBX;
mov 23, ESP;
POP ECX;
MOV d3, ECX;
MOV z4, ESP;
POP EDX;
mov d4, EDX;
What is z3 in Hexidecimal?
O OFFF FFEA
O OFFF FFE6
OFFF FFE2
OFFF FFEE
Chapter 3 Solutions
Starting Out with C++ from Control Structures to Objects (9th 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 - Male and Female Percentages Write a program that...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 - How Many Pizzas? Modify the program you wrote in...Ch. 3 - Angle Calculator Write a program that asks the...Ch. 3 - Stock Transaction Program Last month Joe purchased...Ch. 3 - Planting Grapevines A vineyard owner is planting...Ch. 3 - Word Game Write a program that plays a word game...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
An objects private member variables can be accessed from outside the object by A) public member functions B) an...
Starting Out with C++: Early Objects (9th Edition)
Write a summary list of the problem-solving steps identified in the chapter, using your own words.
BASIC BIOMECHANICS
Average of Numbers Assume a file containing a series of integers is named numbers.txt and exists on the compute...
Starting Out with Python (4th Edition)
The data shown in the following graph was collected during testing of an electromagnetic mass driver. The energ...
Thinking Like an Engineer: An Active Learning Approach (4th Edition)
Find the no-load value of υo in the circuit shown.
Find υo when RL is 150 Ω.
How much power is dissipated in th...
Electric Circuits. (11th Edition)
a. In what way are general-purpose registers and main memory cells similar? b. In what way do general-purpose r...
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
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
- == include using namespace std; # int main () { int a = 14; do { if( a 15) { a = a + 1; } cout << a <<" "; a = a + 1; } while( a < 16 ); } الجواب: إجابةarrow_forwardC++arrow_forwardLowest Score Drop Write a program that calculates the average of a group of test scores, where the lowest score in the group is dropped. It should use the following functions: void getScore() should ask the user for a test score, store it in a reference parameter variable, and validate it. This function should be called by main once for each of the five scores to be entered. void calcAverage() should calculate and display the average of the four highest scores. This function should be called just once by main and should be passed the five scores. int findLowest() should find and return the lowest of the five scores passed to it. It should be called by calcAverage, which uses the function to determine which of the five scores to drop. Input Validation: Do not accept test scores lower than 0 or higher than 100.arrow_forward
- please correct this code i didnt get the mistake #include<stdio.h>#define NROWS 8#define NCOLS 8#define TRUE 1#define FALSE 0 void main(){ int queenht_row, queenht_col; int line,row,col,i,j; int filled; printf("Chess queenht Program\n"); do{ printf("Enter queenht's coordinates: "); scanf("%d %d",&queenht_row,&queenht_col); }while((queenht_row<1)||(queenht_row>NROWS)||(queenht_col<1)||(queenht_col>NCOLS)); for(line=1;line<=2*NROWS+1;line++){ row = line/2; if(line%2!=0){ printf("+"); for(col=1;col<=NCOLS;col++) printf("---+"); printf("\n"); } else{ printf("|"); for(col=1;col<=NCOLS;col++){ filled=FALSE; if((row==queenht_row) && (col==queenht_col)){ printf(" Q |"); filled = TRUE; continue; }…arrow_forwardUsernames An online company needs your help to implement a program that verifies the username chosen by a new user. Their rules is described below: Username MUST contain at least 6 characters; Username cannot start with a number; Username can only contain letters or numbers. If valid, the username may be resgistered if it doesn't already exist in the system. You should not use built-in functions to determine the character type such as isnumeric() or islower(). Use the strings given alphabet and numeric to determine if each character is valid. Use the list registered to help you determine if the username is already registered. Don't forget to execute the cell below to use these strings # run this cell to create these variablesalphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'numeric = "0123456789"registered = ["john87", "topmage", "light4ever", "username2"] Write a function nameValidation which receives a String argument name. This function: has name String…arrow_forwardUsernames An online company needs your help to implement a program that verifies the username chosen by a new user. Their rules is described below: Username MUST contain at least 6 characters; Username cannot start with a number; Username can only contain letters or numbers. If valid, the username may be resgistered if it doesn't already exist in the system. You should not use built-in functions to determine the character type such as isnumeric() or islower(). Use the strings given alphabet and numeric to determine if each character is valid. Use the list registered to help you determine if the username is already registered. Don't forget to execute the cell below to use these strings # run this cell to create these variablesalphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'numeric = "0123456789"registered = ["john87", "topmage", "light4ever", "username2"]arrow_forward
- Usernames An online company needs your help to implement a program that verifies the username chosen by a new user. Their rules is described below: Username MUST contain at least 6 characters; Username cannot start with a number; Username can only contain letters or numbers. If valid, the username may be resgistered if it doesn't already exist in the system. You should not use built-in functions to determine the character type such as isnumeric() or islower(). Use the strings given alphabet and numeric to determine if each character is valid. Use the list registered to help you determine if the username is already registered. Don't forget to execute the cell below to use these strings # run this cell to create these variablesalphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'numeric = "0123456789"registered = ["john87", "topmage", "light4ever", "username2"] Write a function registerName which receives a String username and it returns a string message. This…arrow_forwardProgramming tracing C language Please help it is tracing on c programming kindly input the visual tracing like line where the process start or error Trace the following program: #include<stdio.h>#include<conio.h>void kar1(char *a, char *b, char *c){*a = 'c'; *b='a'; *c ='b';printf("%c %c %c\n", *a, *b, *c);}main(){char a = 'c', b = 'b', c = 'a';clrscr();printf("%c %c %c\n", a, b, c);kar1(&a,&b,&c);printf("%c %c %c\n", a, b, c);kar1(&c,&b,&a);printf("%c %c %c\n", a, b, c);kar1(&b,&a,&c);printf("%c %c %c\n", a, b, c);getch();return 0;}arrow_forwardScreen Output #include #include #define MAX 3 typedef struct { char part[20]; int quantity; float price; }partsRecord; void myParts (void); void printBin(partsRecord *recBin); int main(void) { myParts(); return(0); } void myParts (void) { partsRecord Bin[MAX] = { { "Resistor", 300, 0.05 }, { "Capacitor", 250, 1.03 }, { "Inductor", 123, 0.65 }}; int index; for (index { 0; index part, recBin->quantity, recBin->price); return; } 2c) What type of argument is passed to the printBin function?arrow_forward
- C ++ Using the following code: enum GradeLevel { FRESHMAN, SOPHMORE, JUNIOR, SENIOR }; struct Student { string first; string middle; string last; GradeLevel year; float GPA; }; Student A0012; // Student ID A0012 Student A0013; // Student ID A0013 A0012.first = "Bjarne"; A0012.last = "Stroustrup"; A0012.GPA = 3.56; A0013 = A0012; A0012.year = SENIOR; A0013.middle = "C++"; A0013.year = static_cast<GradeLevels>(A0012.year - 2); A0013.GPA = floor(A0012.GPA); // floor() rounds down to whole number A0012.middle = A0013.middle.at(0) + "."; What are the contents of the Student variables after this code has executed? Use the chart provided. Who is Bjarne Stroustrup?arrow_forward1#include 2 #include #include 4 #include 3 5 sem_t fork[3]; 6 7 void eat (int phil) { 8 printf("Philosopher %d is eating\n", phil); sleep (2); //time eating 9 10} 11 void philosopher (void * num) { int phil-*(int *)num; 12 13 printf("Philosopher %d wants to eat\n", phil); 14 sem_wait (&fork[phil]); 15 sem_wait (&fork [(phil+1)]); 16 eat (phil); 17 18 printf("Philosopher %d has finished eating\n",phil); sem_post(&fork [(phil+1)]); sem_post(&fork[phil]); 19 20} 21 int main(){ 22 int i, a[3]; 23 pthread_t tid[3]; for(i=0;i<3; i++) 24 25 sem_init(&fork[i],0,1); 26 for(i=0;i<3; i++){ 27 a[i]=i; 28 pthread_create(&tid[i], NULL, philosopher, (void *)&a[i]); 29 } 30 for(i=0;i<3;i++) 31 pthread_join(tid[i],NULL); 32} Fig.1 Figure 1 shows a program that tries to solve the dining philosophers' problem given that it only includes 3 philosophers who want to eat, where only 3 forks are available and each philosopher needs two forks. The outputs after running the program are given in Figure 2. In the…arrow_forward#include #include #include "Product.h" using namespace std; int main() { vector productList; Product currProduct; int currPrice; string currName; unsigned int i; Product resultProduct; cin>> currPrice; while (currPrice > 0) { } cin>> currPrice; main.cpp cin>> currName; currProduct.SetPriceAndName (currPrice, currName); productList.push_back(currProduct); resultProduct = productList.at (0); for (i = 0; i < productList.size(); ++i) { Type the program's output Product.h 1 CSE Scanned Product.cpp if (productList.at (i).GetPrice () < resultProduct.GetPrice ()) { resultProduct = productList.at(i); } AM cout << "$" << resultProduct.GetPrice() << " " << resultProduct. GetName() << endl; return 0; Input 10 Cheese 6 Foil 7 Socks -1 Outputarrow_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 - CONSIGNMENT
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 Variables; Author: Neso Academy;https://www.youtube.com/watch?v=fO4FwJOShdc;License: Standard YouTube License, CC-BY