C++ How to Program (10th Edition)
10th Edition
ISBN: 9780134448237
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Chapter 13, Problem 13.8E
Program Plan Intro
- In the program, we include the header files as needed.
- Declaring main() function as integer type.
- Variable declaration: test_value1 as integer with the value 15 and test_ptr as integer pointer.
- Type casting is used to print the value of pointer.
Program Description:
The program is to print the pointer value as integer.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
(Airplane Seating Assignment) | Write a program that can be used to assign seats for a commercial airplane. The airplane has 13 rows, with six seats in each row. Rows 1 and 2 are first class, rows 3 through 7 are business class, and rows 8 through 13 are economy class.
Use two parallel arrays:
a one-dimensional array to store the row number of the seats (Row #)
a two-dimensional array of 13 rows and 6 columns to store the seat assignments (*) and seat letters (A-F)
Your program must prompt the user to enter the following information:
Reserve a seat (Yes (Y/y) or No (N/n))
Assign ticket type (first class (F/f), business class (B/b), or economy class (E/e))
Select desired seat (1-13 and A-F)
Your program must contain at least the following functions:
a function to initialize the seat plan.
a function to show the seat assignments.
a function to show the menu to assign a seat.
a function to assign and select your desired seat.
a function for each ticket type that determines if a seat…
(Airplane Seating Assignment) | Write a program that can be used to assign seats for a commercial airplane. The airplane has 13 rows, with six seats in each row. Rows 1 and 2 are first class, rows 3 through 7 are business class, and rows 8 through 13 are economy class.
Use two parallel arrays:
a one-dimensional array to store the row number of the seats (Row #)
a two-dimensional array of 13 rows and 6 columns to store the seat assignments (*) and seat letters (A-F)
Your program must prompt the user to enter the following information:
Reserve a seat (Yes (Y/y) or No (N/n))
Assign ticket type (first class (F/f), business class (B/b), or economy class (E/e))
Select desired seat (1-13 and A-F)
Your program must contain at least the following functions:
a function to initialize the seat plan.
a function to show the seat assignments.
a function to show the menu to assign a seat.
a function to assign and select your desired seat.
a function for each ticket type that determines if a seat…
(Airplane Seating Assignment) | Write a program that can be used to assign seats for a commercial airplane. The airplane has 13 rows, with six seats in each row. Rows 1 and 2 are first class, rows 3 through 7 are business class, and rows 8 through 13 are economy class.
Use two parallel arrays:
a one-dimensional array to store the row number of the seats (Row #)
a two-dimensional array of 13 rows and 6 columns to store the seat assignments (*) and seat letters (A-F)
Your program must prompt the user to enter the following information:
Reserve a seat (Yes (Y/y) or No (N/n))
Assign ticket type (first class (F/f), business class (B/b), or economy class (E/e))
Select desired seat (1-13 and A-F)
Your program must contain at least the following functions:
a function to initialize the seat plan.
a function to show the seat assignments.
a function to show the menu to assign a seat.
a function to assign and select your desired seat.
a function for each ticket type that determines if a seat…
Chapter 13 Solutions
C++ How to Program (10th Edition)
Ch. 13 - (Write C ++ statements) Write a statement for each...Ch. 13 - (Inputting Decimal, Octal and Hexadecimal Values)...Ch. 13 - Prob. 13.8ECh. 13 - (Printing with field Widths) Write a program to...Ch. 13 - (Rounding) Write a program that prints the value...Ch. 13 - (Length of a String) Write a program that inputs a...Ch. 13 - (Converting Fahrenheit to Celsius) Write a program...Ch. 13 - In some programming language, string are entered...Ch. 13 - Prob. 13.14ECh. 13 - Prob. 13.15E
Knowledge Booster
Similar questions
- State whether the following are true or false. If the answer is false, explain why.a) A pointer that’s declared to be void can be dereferenced.arrow_forward(Sort three numbers) Write the following function to display three numbers in increasing order: def displaySortedNumbers(num1, num2, num3): Write a test program that prompts the user to enter three numbers and invokes the function to display them in increasing order. Here are some sample runs:arrow_forwardusing c++ programming ::::: 16. (Pick 5 Lotto) Write a program to simulate a pick-5 lottery game. Your program should generate and store 5 distinct numbers between 1 and 9 (inclusive) into an array. The program prompts the user to enter five distinctbetween 1 and 9 and stores the number into another array. The programthen compares and determines whether the two arrays are identical. If thetwo arrays are identical, then the user wins the game; otherwise the program outputs the number of matching digits and their position in the array.Your program must contain a function that randomly generates thepick-5 lottery numbers. Also, in your program, include the functionsequential search to determine if a lottery number generated hasalready been generated.arrow_forward
- (Replace strings) Write the following function that replaces the occurrence of a substring old_substring with a new substring new_substring in the string s. The function returns true if string s is changed, and otherwise, it returns false. bool replace_strings (string& s, const string& old_string, const string& new_string) Write a test program that prompts the user to enter three strings, i.e., s, old string, and new_string, and display the replaced string.arrow_forward(Random sentences and story writer) Write an app that uses random-number generation to create sentences. Use four arrays of strings, called article, noun, verb andprepostion. Create a sentence by selecting a word at random from each array in the following order: article, noun, verb, preposition, article, noun.As each word is picked, concatenate it to the previous words in the sentence. The words should be separated by spaces. When the sentence is output, it should start witha capital letter and end with a period. The program should generate 10 sentences and output them to a text box. The arrays should be filled as follows:The article array should contain the articles "the", "a", "one", "some" and "any";The noun array should contain the nouns "boy", "girl", "dog", "town", "car";The verb array should contain the past tense verbs "drove", "jumped", "ran", "walked" and "skipped";The preposition array should contain the preposotions "to", "from", "over", "under" and "on";arrow_forwardState whether the following are true or false. If the answer is false, explain why.b) Pointers of different types may not be assigned to one another without a cast operation.arrow_forward
- (CAN YOU MAKE LESS FUNTIONS AND DO IT SIMPLE AND UNIQUE? PLEASE. THANK YOU ) PROGRAM IN C++ Odette's typhoon-related casualties. Create an array-based program that accepts the following data: the names of typhoon Odette victims, their ages, and their current status (A – alive, D – deceased, I – wounded, and M – missing). Your arrays should be proportionate to the barangay's expected population. Enter the barangay's name and the typhoon's projected total population. Following data entry, show the following information about each person according to their name - their name (in alphabetical order), their condition, the number of individuals who survived, died, were injured, or went missing, as well as their proportion of the total population. An Earthquake's Accident CODE OUTPUT : Barangay Name:____ Estimated NO. of residents:________ Name:____ Age:__ (A – alive, D – deceased, I – wounded, and M – missing)___ Additional Entry (Y/N)? Y…arrow_forward(Java) Write a Java program that reads 20 integer numbers from the user using a loop. The program should find and display the largest number and the smallest number and the average of the 20 numbers entered.You Should not use arrays.You should have comments in your code.Run the program and take screenshots. Submit your Java code file and the screenshotsarrow_forward(Intro to Java) explain the answers to the below questions using step-by-step explanation.arrow_forward
- (Sorting and Array in Ascending Order) Write a program that asks the user to input the number of elements of an integer array and its elements. The program then sorts the inputted array in ascending order. In C languagearrow_forwardWhich of the following statements are true for static arrays in C++? Static arrays are declared with a size at compile time. (select all that are true) Every element in an array has the same base type. The array will grow dynamically to accommodate additional elements. The array elements are initialized to 0 when an array is created. O Array size must be declared by a constant expression O The array must be explicitly deleted when the programmer is done with it.arrow_forwardplease answer within 30 minutes.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 Ptr
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr