Starting Out with Java: From Control Structures through Objects (6th Edition)
6th Edition
ISBN: 9780133957051
Author: Tony Gaddis
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
Chapter 11, Problem 10MC
Program Description Answer
The “call stack” is an internal list which hold the all the currently executing methods.
Hence, the correct answer is option “B”.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
can you do it in python, thank you.
For WriteToFile, describe what it does
Challenge task
Yousef is a good student in Math and Programming. Every Math lesson his teacher gives his
class a Math problem to be solved using a C++ program. Yousef fascinated by this, and sometimes
he gets a full mark.
Today he took the following task in the Math lesson:
If you have an integer number N consisting of a list of digits (D1, D2, D3, ... Dm), find and print the
result of the following equation:
Dm – 1
Dm
+
D1
+
2
An example:
If the integer is 2356 then
6 5
+
2
- +
2
3
= -1.000
2
Can you help Yousef in order to get a full mark in this task?
Constraints
20 < Ns 10°
Input Format
An integer number N
E Output Format
Print the following message
The Result is X
where X represents the result of the equation in 3 decimal places.
O Sample #1
Input
2356
Output
The Result is -1.000
O Sample #2
Input
21
Output
The Result is 0.500
Chapter 11 Solutions
Starting Out with Java: From Control Structures through Objects (6th Edition)
Ch. 11.1 - Prob. 11.1CPCh. 11.1 - Prob. 11.2CPCh. 11.1 - Prob. 11.3CPCh. 11.1 - Prob. 11.4CPCh. 11.1 - Prob. 11.5CPCh. 11.1 - Prob. 11.6CPCh. 11.1 - Prob. 11.7CPCh. 11.1 - Prob. 11.8CPCh. 11.1 - Prob. 11.9CPCh. 11.1 - When does the code in a finally block execute?
Ch. 11.1 - What is the call stack? What is a stack trace?Ch. 11.1 - Prob. 11.12CPCh. 11.1 - Prob. 11.13CPCh. 11.1 - Prob. 11.14CPCh. 11.2 - What does the throw statement do?Ch. 11.2 - Prob. 11.16CPCh. 11.2 - Prob. 11.17CPCh. 11.2 - Prob. 11.18CPCh. 11.2 - Prob. 11.19CPCh. 11.3 - What is the difference between a text file and a...Ch. 11.3 - What classes do you use to write output to a...Ch. 11.3 - Prob. 11.22CPCh. 11.3 - What class do you use to work with random access...Ch. 11.3 - What are the two modes that a random access file...Ch. 11.3 - Prob. 11.25CPCh. 11 - Prob. 1MCCh. 11 - Prob. 2MCCh. 11 - Prob. 3MCCh. 11 - Prob. 4MCCh. 11 - FileNotFoundException inherits from __________. a....Ch. 11 - Prob. 6MCCh. 11 - Prob. 7MCCh. 11 - Prob. 8MCCh. 11 - Prob. 9MCCh. 11 - Prob. 10MCCh. 11 - Prob. 11MCCh. 11 - Prob. 12MCCh. 11 - Prob. 13MCCh. 11 - Prob. 14MCCh. 11 - Prob. 15MCCh. 11 - This is the process of converting an object to a...Ch. 11 - Prob. 17TFCh. 11 - Prob. 18TFCh. 11 - Prob. 19TFCh. 11 - True or False: You cannot have more than one catch...Ch. 11 - Prob. 21TFCh. 11 - Prob. 22TFCh. 11 - Prob. 23TFCh. 11 - Prob. 24TFCh. 11 - Find the error in each of the following code...Ch. 11 - // Assume inputFile references a Scanner object,...Ch. 11 - Prob. 3FTECh. 11 - Prob. 1AWCh. 11 - Prob. 2AWCh. 11 - Prob. 3AWCh. 11 - Prob. 4AWCh. 11 - Prob. 5AWCh. 11 - Prob. 6AWCh. 11 - The method getValueFromFile is public and returns...Ch. 11 - Prob. 8AWCh. 11 - Write a statement that creates an object that can...Ch. 11 - Write a statement that opens the file...Ch. 11 - Assume that the reference variable r refers to a...Ch. 11 - Prob. 1SACh. 11 - Prob. 2SACh. 11 - Prob. 3SACh. 11 - Prob. 4SACh. 11 - Prob. 5SACh. 11 - Prob. 6SACh. 11 - What types of objects can be thrown?Ch. 11 - Prob. 8SACh. 11 - Prob. 9SACh. 11 - Prob. 10SACh. 11 - What is the difference between a text file and a...Ch. 11 - What is the difference between a sequential access...Ch. 11 - What happens when you serialize an object? What...Ch. 11 - TestScores Class Write a class named TestScores....Ch. 11 - Prob. 2PCCh. 11 - Prob. 3PCCh. 11 - Prob. 4PCCh. 11 - Prob. 5PCCh. 11 - FileArray Class Design a class that has a static...Ch. 11 - File Encryption Filter File encryption is the...Ch. 11 - File Decryption Filter Write a program that...Ch. 11 - TestScores Modification for Serialization Modify...Ch. 11 - Prob. 10PC
Knowledge Booster
Similar questions
- Write the part of the program that searches for the name of the coffee add-in(s) and either prints the name and price of the add-in or prints the error message if the add-in is not found. Comments in the code tell you where to write the statements. Write the code that searches the list for the name of the add-in ordered by the customer. Write the code that prints the name and price of the add-in or the error message, and then write the code that prints the cost of the total order. Execute the program using the following data and verify that the output is correct: Cream Caramel Whiskey chocolate Chocolate Cinnamon Vanilla # JumpinJava.py - This program looks up and prints the names and prices of coffee orders. # Input: Interactive # Output: Name and price of coffee orders or error message if add-in is not found # Declare variables. NUM_ITEMS = 5 # Named constant # Initialized list of add-ins addIns = ["Cream", "Cinnamon", "Chocolate", "Amaretto", "Whiskey"] #…arrow_forwardC++: Create a basic contact book where you can store and then retrieve contact information.The information that (at least) should be able to be stored is name (postal) address e-mail address telephone number Birthday, other. It should work as follows. The user should be able to choose what he wants to do, for example : add contact or find the phone number of a given contact. There are several ways to implement this, for example: • To have a menu where the user can choose by entering a number corresponding to one of the menu options. Exit should be one of the options. • where the user gives commands for what to do. The functionality that must exist is • to add a contact, • to delete a contact, • to search for a contact. The contact book should be saved in a file so that it does not disappear between runs of the program.arrow_forwardPYTHON project I need help creating a python command line custom help menu class with method that uses user input to print specific help messages. I need it to accept a user input command, one of the possible commands are "help" and "help keyword", which print a message that corresponds to 5 different keywords as well as the basic "help".The flow of the program: User inputs a command from a printed list, one of them being "help" which prints "a general help message". The if a user inputs "help input" it prints "a help message about the input function", or "help parse" it prints "a help message about the parse function", for 5 different keyword options. You can use any names, I will change them later. This program is just one part of a larger program, so it doesn't RELY on the user to input anything, but if the user does input the specific command, it will respond accordingly.I feel like an array or some kind of independent structure would work best, but I'm not sure. I'm not familiar…arrow_forward
- In C Programming Language Palindrome: “A palindrome is a word, phrase, number, or other sequence of characters which reads the same backward or forward, such as ‘madam’ or ‘kayak’” (excerpt from Wikipedia).Write a program that reads 8 words from Palindrome.txt and checks whether the word you read is a palindrome (please read its description above) or not. Print the index numbers of all the palindrome words in your array. You are required to read words character by character into a character array.• Write readFile function, which gets a file pointer and a two-dim array, to read each word(bunch of characters) line by line and store them into a two-dim character array.• Write findSize function takes a one-dim array and returns its actual size.• Write isPalindrome function takes a one-dim character array to check whether the content is a polindrome or not. If the word (character squence) is a palindrome, then it returns 1. Otherwise, it returns 0.arrow_forwardJava OOP Write a complete address book maintenance application. The user of the program has four options: Add a new person, delete a person, modify the data of a person, and search for a person by giving the name. Use the AddressBook class, either the original one from the chapter or the modified one from the previous exercises. You have to decide how to allow the user to enter the values for a new person, display person information, and so forth.arrow_forwardPython question Application: Python Fragment Formulation (Q1 – Q4) In this group of questions you are asked to produce short pieces of Python code. When you are asked to "write a Python expression" to complete a task, you can either give the expression in one line or break down the task into several lines. The last expression you write must represent the required task. Question 1 (Reduce parentheses) Give an equivalent version of this expression by removing as many redundant parentheses as possible, without expanding the brackets or simplifying. (x**(2**y))+(y*((z+x)**3)) Question 2 (Translate arithmetic concept into Python) You are given a list of numbers, named numbers, containing 3 integers. Write a python expression (one line) that evaluates to True if and only if the product of any two numbers in the given list is greater than the sum of all three numbers. Note: the product of two numbers, x and y is x*y. Question 3 (List/table access) You are given a table,…arrow_forward
- Program definition: Write a program that simulates the game “hangman”. a. In the game of hangman, have a user enter a word for “another” player to guess. b. After the word to guess is entered, clear the screen and present a list of blanks or underscores representing unguessed letters of the hidden word. c. Have the user guess a letter in the word. If the letter is in the word, display the letter instead of the blank or underscore and display the remaining blanks or underscores for the unguessed letters, all in the proper position. d. If a previously guessed letter is repeated, whether in the word or not, another try is allowed without penalty. If a guess is incorrect, the game state progresses toward being “hung”. e. There are 8 bad guesses allowed before the game is lost. f. The game will progress through the states of PLATORM, HEAD, BODY, LEFT_ARM, RIGHT_ARM, LEFT_LEG, RIGHT_LEG, and HUNG. Use an ENUM to represent the game states listed. g. Use a linked list to…arrow_forwardIn c++, Using STL containers, components, and algorithms show all data from the text file movies.txt. Please make sure the list updates once the user adds a new movie to the text file. Console Movies program COMMAND MENU show - user is able to see all available movies from movies.txt command: show The Adventures of a Babysitter $10 Barney $25 Larry the Car Man $15 Dora and the missing map $15 Ceasar and the Lunch Lady $10 Suzie and the Bad Kids $13.95 command: add cout << "What movie do you want to add?"; cin >> BeeHive $12; cout << "Movie added"; command:show The Adventures of a Babysitter $10 Barney $25 Larry the Car Man $15 Dora and the missing map $15 Ceasar and the Lunch Lady $10 Suzie and the Bad Kids $13.95 Beehive $12 movies.txt with all possible movies: The Adventures of a Babysitter $10 Barney $25 Larry the Car Man $15 Dora and the missing map $15 Ceasar and the Lunch Lady $10 Suzie and the Bad Kids $13.95arrow_forwardA loop that processes a list of things is known as a for construct. As a result, it keeps running as long as there are objects to process. Is this statement correct or incorrect?arrow_forward
- Python task: Task OverviewYour task is to implement a variation of the classic word game Hangman, which involves playersguessing the letters in a word chosen at random with a finite number of guesses. While there arealternate versions such as category Hangman and Wheel of Fortune, which involve playersguessing idioms, places, names and so on, we will be sticking with the traditional version.If you are unfamiliar with the rules of the game, please read the following before starting:http://en.wikipedia.org/wiki/Hangman_(game). You can also play an online version here. Don’tbe intimidated - You’ll be given some skeleton code to get you started, it's easier than it looks! You will implement a function called main that allows users to play an interactive hangman gameagainst the computer. The computer should pick a word, and players should then try to guess lettersin the word until they win or run out of guesses.Here is the overarching behaviour we expect:1. The program should load a list of…arrow_forwardIn computational geometry, often you need to find the rightmost lowest point in a set of points. Write the following function that returns the rightmost lowest point in a set of points:# Return a list of two values for a pointdef getRightmostLowestPoint(points):Write a test program that prompts the user to enter the coordinates of six points and displays the rightmost lowest point.arrow_forwardA contact list is a place where you can store a specific contact with other associated information such as a phone number, email address, birthday, etc. Write a program that first takes in word pairs that consist of a name and a phone number (both strings). That list is followed by a name, and your program should output the phone number associated with that name. Ex: If the input is: Joe 123-5432 Linda 983-4123 Frank 867-5309 Frank the output is: 867-5309 LAB 6.21.1: LAB: Contact list 0/ 10 ACTIVITY main.py Load default template... 1 user_input = input() 2 entries = user_input.split() 3 contact_list = dict(pair. split(':') for pair in entries)arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT