bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 3, Problem 14PP

You have an augmented reality game in which you catch Edoc and acquire Edoc candy. You need 12 candies to evolve an Edoc into a Margorp. An evolution earns you back one candy. Each evolution also earns you 500 experience points. An Edoc or Margorp can each be transferred for one Edoc candy. In support of the game’s players, write an Edoc calculator program that inputs the number of Edoc you have caught and the number of Edoc candies in your possession. You can assume the initial number of Margorps is 0. The program should output the maximum number of experience points you can earn through transfers and evolutions. After Edocs evolve into Margorps your program should consider if transferring the Margorps will result in enough candy to evolve even more Edoc. For example, if you start with 71 candies and 53 Edoc, the program could output the following. Note that there are many other sequences of transfers and evolutions, with possibly a different final number of Edoc and Margorp, but the total number of experience points should be the same (the max possible):

Transfer 37 Edoc and 0 Margorp resulting in

108 candy, 16 Edoc, and 0 Margorp

Evolve 9 Edoc to get 4500 experience points and resulting in

9 candy, 7 Edoc, and 9 Margorp

Transfer 0 Edoc and 9 Margorp resulting in

18 candy, 7 Edoc, and 0 Margorp

Evolve 1 Edoc to get 500 experience points and resulting in

7 candy, 6 Edoc, and 1 Margorp

Transfer 4 Edoc and 1 Margorp resulting in

12 candy, 2 Edoc, and 0 Margorp

Evolve 1 Edoc to get 500 experience points and resulting in

1 candy, 1 Edoc, and 1 Margorp

Total experience points = 5500

Blurred answer
Students have asked these similar questions
The equation of a straight line is written as y = mx + b where m is the slope of the line and b is the value of y when x = 0. If there are two coordinate points of the line are given, then it is very easy to compute the line equation. Also you can find the distance between two points. Problem: Write a program to compute lines equation for a set of lines. The number of lines is read from the user. Each line is computed by generating two points randomly using Point2D API. In addition, distance between two points is computed. The program should display a table which include all information about each line. See sample runs below. Take into consideration: 1. Number of generated lines should be greater than zero. 2. Two point objects are constructed only once. Then just update the location of two points for each line using Point2D API methods. 3. x and y values of each point are generated randomly to be less than 100 and greater than 0. 4. Compute the distance between two points using…
You are working for a lumber company, and your employer would like a program that calculates the cost of lumber for an order. The company sells pine, fir, cedar, maple, and oak lumber. Lumber is priced by board feet. One board foot equals one square foot that is one inch thick. Theprice per board foot is given in the following table: Pine 0.89Fir 1.09Cedar 2.26Maple 4.50Oak 3.10 The lumber is sold in different dimensions (specified in inches of width and height, and feet of length) that need to be converted to board feet. For example, a 2 x 4 x 8 piece is 2 inches wide, 4 inches high, and 8 feet long, and is equivalent to 5.333 board feet (2 * 4 * 8 = 64, which when divided by 12 = 5.333 board feet). An entry from the user will be in the form of a letter and four integer numbers. The integers are the number of pieces, width, height, and length. The letter will be one of P, F, C, M, O (corresponding to the five kinds of wood) or T, meaning total. When the letter is T, there are no…
AGU Computer Engineering Department created a new mathematical game that can be played with two people. In this game, you are given a list of random integers. At each round, the first player takes two numbers from the list and calculates the sum of these numbers. Then, the second player takes two numbers and makes the same calculation. The higher one is going to take the round and increment the score by 1. At the end of the game, who has the better score will win the game. Here are the rules for the game: There are always an even number of items on the list There are two colors for the players: Green and Red Green starts the game At each round, green plays and then red plays The player takes the first and the last numbers The game can end Tie when the scores are the same. The game will end when there is no element to take from the list Your program will simulate the rounds and find out the winner, Green or Red or Tie. The input will be two lines. Input Format…

Chapter 3 Solutions

Problem Solving with C++, Student Value Edition Plus MyLab Programming with Pearson eText - Access Card Package (10th Edition)

Ch. 3.2 - What output will be produced by the following...Ch. 3.2 - Write a multiway if-else statement that classifies...Ch. 3.2 - Given the following declaration and output...Ch. 3.2 - Given the following declaration and output...Ch. 3.2 - What output will be produced by the following...Ch. 3.2 - What would be the output in Self-Test Exercise 15...Ch. 3.2 - What would be the output in Self-Test Exercise 15...Ch. 3.2 - What would be the output in Self-Test Exercise 15...Ch. 3.2 - Prob. 19STECh. 3.2 - Though we urge you not to program using this...Ch. 3.3 - Prob. 21STECh. 3.3 - Prob. 22STECh. 3.3 - What is the output of the following (when embedded...Ch. 3.3 - What is the output of the following (when embedded...Ch. 3.3 - Prob. 25STECh. 3.3 - What is the output of the following (when embedded...Ch. 3.3 - Prob. 27STECh. 3.3 - For each of the following situations, tell which...Ch. 3.3 - Rewrite the following loops as for loops. a.int i...Ch. 3.3 - What is the output of this loop? Identify the...Ch. 3.3 - What is the output of this loop? Comment on the...Ch. 3.3 - What is the output of this loop? Comment on the...Ch. 3.3 - What is the output of the following (when embedded...Ch. 3.3 - What is the output of the following (when embedded...Ch. 3.3 - What does a break statement do? Where is it legal...Ch. 3.4 - Write a loop that will write the word Hello to the...Ch. 3.4 - Write a loop that will read in a list of even...Ch. 3.4 - Prob. 38STECh. 3.4 - Prob. 39STECh. 3.4 - What is an off-by-one loop error?Ch. 3.4 - You have a fence that is to be 100 meters long....Ch. 3 - Write a program to score the paper-rock-scissor...Ch. 3 - Write a program to compute the interest due, total...Ch. 3 - Write an astrology program. The user types in a...Ch. 3 - Horoscope Signs of the same Element are most...Ch. 3 - Write a program that finds and prints all of the...Ch. 3 - Buoyancy is the ability of an object to float....Ch. 3 - Write a program that finds the temperature that is...Ch. 3 - Write a program that computes the cost of a...Ch. 3 - (This Project requires that you know some basic...Ch. 3 - Write a program that accepts a year written as a...Ch. 3 - Write a program that scores a blackjack hand. In...Ch. 3 - Interest on a loan is paid on a declining balance,...Ch. 3 - The Fibonacci numbers F are defined as follows. F...Ch. 3 - The value ex can be approximated by the sum 1 + x...Ch. 3 - Prob. 8PPCh. 3 - Prob. 9PPCh. 3 - Repeat Programming Project 13 from Chapter 2 but...Ch. 3 - The keypad on your oven is used to enter the...Ch. 3 - The game of 23 is a two-player game that begins...Ch. 3 - Holy digits Batman! The Riddler is planning his...Ch. 3 - You have an augmented reality game in which you...

Additional Engineering Textbook Solutions

Find more solutions based on key concepts
What is a user interface?

Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)

Is Java a high-level language or a low-level language?

Java: An Introduction to Problem Solving and Programming (8th Edition)

What data structure does Python use in place of arrays?

Concepts of Programming Languages (11th Edition)

T F Public members of a private base class become private members of the derived class.

Starting Out with C++ from Control Structures to Objects (8th Edition)

What is a keyword? List some Java keywords.

Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)

Knowledge Booster
Background pattern image
Computer Science
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
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Control Structure in Data Structure - Data Structures - Computer Science Class 12; Author: Ekeeda;https://www.youtube.com/watch?v=9FTw2pXLhv4;License: Standard YouTube License, CC-BY