Hints for Liang C++ Revel Quizzes and Programming Projects with CodeGrade
Introduction to C++ Programming and Data Structures 5E by Y. Daniel Liang
If you need a hint on an exercise that is not listed here, please contact Dr. Liang at y.daniel.liang@gmail.com.
Please check this page often. We update this page frequently in response to student questions. Last update:
.
NOTE: Errata can be viewed at https://liangcpp.pearsoncmg.com/errata.html.
Please send corrections and suggestions to Dr. Liang at y.daniel.liang@gmail.com. We appreciate your help to improve the book.
NOTE: In the expected output pattern of a test run, [\s\S]* represents zero or more number of any characters.
NOTE: For all quizzes and programming projects, use the double type rather
than the float type for real numbers unless explicitly specified otherwise, because some quizzes may not grade correctly if the float type is used.
Hints for End-of-Section Programming Quizzes:
Programming Quiz 2.5 Question 2
Hint:
You need to use a single statement for this exercise. The following code is logically correct, but it has three statements:
double x = 1.62;
double y = 6.52;
double z = -0.5;
Programming Quiz 3.5 Question 2
Hint:
You may write the code like this:
if (gpa >= 3.8)
{
if (extracurriculars >= 2)
{
if (serviceHours >= 50)
{
// Assign an appropriate value to scholarshipLevel
}
else
{
// Assign an appropriate value to scholarshipLevel
}
}
else
{
// Assign an appropriate value to scholarshipLevel
}
}
else
{
// Assign an appropriate value to scholarshipLevel
}
Programming Quiz 4.8 Question 4
Hint:
You may write the code like this:
string name;
int age;
getline(cin, name, ':');
cin >> age;
// Write the rest of the code
Programming Quiz 5.2 Question 1
Hint:
Your code should look like this:
counter = 1;
while (counter <= 50)
{
// Write the code to output text
counter++;
}
Programming Quiz 5.4 Question 2
Hint:
Note that n is inputted from the user.
Programming Quiz 5.7 Question 1
Hint:
Same as Section 5.2 Question 1, except that you need to use the do-while loop in this exercise.
Your code should look like this:
counter = 49;
do
{
// Write your code to output text
counter--;
}
while (counter >= 0);
Programming Quiz 5.7 Question 3
Hint:
Your code should look like this:
cout << "Enter a positive integer to start the sequence: ";
cin >> un;
counter = 0;
cout << "The sequence is" << endl;
do
{
cout << "u" << counter << " = " << un << "\n";
// update un
// divide it by 2 if it is even, or multiply it by 3 and add 1 if it is odd.
counter++;
}
while (un != 1);
cout << "u" << counter << " = " << un << "\n";
Programming Quiz 5.8 Question 2
Hint:
If you enter n with 5, your code should print:
u0 = 2
u1 = 1
u2 = 3
u3 = 4
u4 = 7
u5 = 11
Your code may look like this:
cout << "Enter an integer: ";
cin >> n;
int u0 = 2;
int u1 = 1;
int un, i;
cout << "u0 = " << u0 << "\n";
cout << "u1 = " << u1 << "\n";
for (i = 2; i <= n; i++)
{
// write your code here.
}
Programming Quiz 5.8 Question 3
Hint:
Test the condition using
if (i % 10 == 1 && i % 3 == 0)
Programming Quiz 5.10 Question 3
Hint:
You may write the code like this:
int p = -1, i, j;
string s;
cout << "Insert a string: ";
cin >> s;
for (i = 0; i < s.length(); i++)
{
for (j = i + 1; j < s.length(); j++)
{
if (s[i] == s[j])
{
// Write your code here
break;
}
}
if (p != -1)
break;
}
if (p == -1)
{
cout << "No repeated character was found";
}
Programming Quiz 7.11 Question 4
Hint:
Assume the string always contains at least one non-digit character. Write your code as follows:
#include <cctype>
#include <cstring>
int stringToNumber(const char str[])
{
int result = 0;
int i = 0;
for (int i = 0; isdigit(str[i]); i++)
{
// Write your code here
}
return result;
}
Programming Quiz 9.3 Question 5
Hint:
You may write the code like this:
class Rectangle
{
public:
double width; // Public data field for the width of the rectangle
double length; // Public data field for the length of the rectangle
// No-argument constructor that sets width and length to 100
Rectangle()
{
width = length = 100;
}
// Constructor that allows setting width and length to specific values
Rectangle(double newWidth, double newLength)
{
// Write your code here
}
// Function to set a new value to width
void setWidth(double newWidth)
{
// Write your code here
}
// Function to set a new value to length
void setLength(double newLength)
{
// Write your code here
}
// Function to get the current value of width
double getWidth()
{
// Write your code here
}
// Function to get the current value of length
double getLength()
{
// Write your code here
}
// Function to calculate and return the area of the rectangle
double getArea()
{
// Write your code here
}
};
Programming Quiz 9.3 Question 6
Hint:
You may write the code like this:
#include <string>
using namespace std;
class Thermostat
{
public:
double currentTemperature; // Current room temperature
double targetTemperature; // Desired target temperature
// Constructor to initialize the thermostat with initial and target
// temperatures
Thermostat(double initialTemperature, double target)
{
// Write your code here
}
// Sets a new target temperature
void setTargetTemperature(double newTarget)
{
// Write your code here
}
// Increases the current temperature, not exceeding the target temperature
void increaseCurrentTemperature(double amount)
{
currentTemperature += amount;
if (currentTemperature > targetTemperature)
{
currentTemperature = targetTemperature;
}
}
// Decreases the current temperature, not falling below the target temperature
void decreaseCurrentTemperature(double amount)
{
// Write your code here
}
// Returns the current temperature
double getCurrentTemperature()
{
// Write your code here
}
// Returns the target temperature
double getTargetTemperature()
{
// Write your code here
}
// Returns a string indicating the heating/cooling status
string getStatus()
{
if (currentTemperature < targetTemperature)
{
return "Heating";
}
else if (currentTemperature > targetTemperature)
{
// Write your code here
}
else
{
// Write your code here
}
}
};
Programming Quiz 9.9 Question 2
Hint:
Write your code like this:
#include "Timer.h"
// Constructor implementation
Timer::Timer(int startTime, int newEndTime)
{
// Write your code here
}
// Decrease currentTime by 1, ensuring it doesn't fall below 0
void Timer::tick()
{
// Write your code here
}
// Reset currentTime back to endTime
void Timer::reset()
{
// Write your code here
}
// Return the current value of currentTime
int Timer::getCurrentTime()
{
// Write your code here
}
// Implement the rest of the functions on setCurrentTime, getEndTime, and setEndTime
Programming Quiz 9.11 Question 1
Hint:
You are asked to write the header file only.
You may write the code like this:
#ifndef DATE_MANAGER_H
#define DATE_MANAGER_H
class DateManager
{
// Write your code here
};
#endif // DATE_MANAGER_H
Programming Quiz 9.11 Question 2
Hint:
You may write the code like this:
#include "InventoryItem.h"
// Default constructor
InventoryItem::InventoryItem()
{
// Write your code here
}
// Parameterized constructor
InventoryItem::InventoryItem(string name, int qty, double priceValue)
{
itemName = name;
quantity = qty;
price = priceValue;
if (price < 0)
price = 0;
if (quantity < 0)
quantity = 0;
}
// Getters
string InventoryItem::getItemName()
{
// Write your code here
}
int InventoryItem::getQuantity()
{
// Write your code here
}
double InventoryItem::getPrice()
{
// Write your code here
}
// Setters
void InventoryItem::setItemName(string name)
{
// Write your code here
}
void InventoryItem::setQuantity(int qty)
{
// Write your code here
}
void InventoryItem::setPrice(double priceValue)
{
// Write your code here
}
// Member function
double InventoryItem::calculateTotalValue()
{
// Write your code here
}
Programming Quiz 10.4 Question 2
Hint:
Your code may look like this:
Student students[NUMBER_OF_STUDENTS];
for (int i = 0; i < NUMBER_OF_STUDENTS; i++)
{
string username;
unsigned long id;
double gpa;
// Write your code to get input on username, id, and gpa
students[i] = Student(username, id, gpa);
}
Programming Quiz 10.5 Question 1
Hint:
Remember to add the area of this new rectangle in the constructor.
Remember to adjust the area when the area's width changed. So, adjust totalArea in setWidth.
Remember to adjust the area when the area's height changed. So, adjust totalArea in setHeight.
Programming Quiz 10.5 Question 3
Hint:
Your code may look like this:
InventoryItem InventoryItem::fromInput()
{
double price;
unsigned int maxStock;
string tagName;
string storeCode = InventoryItem::storeCode;
bool startsWithStoreCode = false;
do
{
cout << "Tag name of the item: ";
cin >> tagName;
startsWithStoreCode =
storeCode.compare(tagName.substr(0, storeCode.size())) == 0;
if (!startsWithStoreCode)
cout << "The tag name must start with the store code." << endl;
}
while (!startsWithStoreCode);
do
{
// prompt the user to enter price and validate it
}
while (price < 0.01);
// prompt the user to enter the max stock
return InventoryItem(price, maxStock, tagName);
}
Programming Quiz 10.5 Question 4
Hint:
Your code may look like this:
#include "Logger.h"
#include <iostream>
#include <string>
using namespace std;
int Logger::numOfWarns=0;
int Logger::numOfErrs=0;
int Logger::numOfLogs=0;
void Logger::resetNumOfLogs()
{
// write your code here
}
void Logger::resetNumOfWarns()
{
// write your code here
}
void Logger::resetNumOfErrs()
{
// write your code here
}
int Logger::getNumOfLogs()
{
// write your code here
}
int Logger::getNumOfWarns()
{
// write your code here
}
int Logger::getNumOfErrs()
{
// write your code here
}
void Logger::log(string msg)
{
// write your code here
}
void Logger::warn(string msg)
{
// write your code here
}
void Logger::err(string msg)
{
// write your code here
}
Programming Quiz 13.4 Question 1
Hint:
You may read an item (a sender or a message) separated by | using getline(input, item, '|'), where input is from ifstream input("messages").
Programming Quiz 14.8 Question 1
Hint:
Your code may look like this:
class Book
{
public:
Book(int pageCount): pageCount(pageCount) {}
friend const Book& biggerBook(const Book& b1, const Book& b2)
{
// Write your code here
}
private:
int pageCount;
};
Programming Quiz 14.9 Question 1
Hint:
Your code may look like this:
#include <iostream>
using namespace std;
class Book
{
private:
string title, author;
public:
Book(string title, string author): title(title), author(author) {};
friend ostream& operator<<(ostream& os, const Book& book)
{
// Write your code here
}
};
Programming Quiz 14.9 Question 2
Hint:
Your code may look like this:
#include <iostream>
#include <string>
using namespace std;
class Book
{
private:
string title, author;
public:
Book(string title, string author): title(title), author(author) {};
Book(){};
friend istream& operator>>(istream& is, Book& book) {
// Write your code here
}
friend ostream& operator<<(ostream& os, const Book& book) {
// Copy the code you implemented from the preceding quiz.
}
};
Assume title and author may contain spaces and the title and author are entered in separate lines.
You need to use the getline function to read input into book.title and book.author, respectively.
Programming Quiz 15.2 Question 1
Hint:
Your code may look like this:
class ElectricCar : public Vehicle
{
public:
ElectricCar(double batteryCapacity, string chargingTypeStr);
double getBatteryCapacity();
int getChargingType();
private:
double batteryCapacity;
int chargingType;
};
ElectricCar::ElectricCar(double batteryCapacity, string chargingTypeStr)
: batteryCapacity(batteryCapacity)
{
// Write your code here
}
double ElectricCar::getBatteryCapacity() {
// Write your code here
}
int ElectricCar::getChargingType() {
// Write your code here
}
Programming Quiz 15.2 Question 2
Hint:
Your code may look like this:
#include "Book.h"
#include "EBook.h"
#include <sstream>
#include <string>
EBook::EBook(string isbn, string publishDate, string title, int pages,
string url)
: Book(isbn, publishDate, title, pages), url(url)
{
}
string EBook::toString() const
{
// Write your code here
}
Programming Quiz 15.2 Question 3
Hint:
Your code may look like this:
#include <string>
#include <iostream>
#include <iomanip>
#include <sstream>
using namespace std;
class Employee {
private:
string name;
int employeeID;
double salary;
public:
Employee(string name, int employeeID, double salary) : name(name), employeeID(employeeID), salary(salary) {}
string getName() { return name; }
int getEmployeeID() { return employeeID; }
double getSalary() { return salary; }
void setName(string newName) { name = newName; }
void setEmployeeID(int newID) { employeeID = newID; }
void setSalary(double newSalary) { salary = newSalary; }
};
class Manager : public Employee {
private:
string department;
public:
Manager(string name, int employeeID, double salary, string department)
: Employee(name, employeeID, salary), department(department) {}
string getDepartment() { return department; }
void setDepartment(string newDepartment) { department = newDepartment; }
string displayDetails() {
// Write your code here
}
};
class Staff : public Employee {
private:
string position;
public:
Staff(string name, int employeeID, double salary, string position)
: Employee(name, employeeID, salary), position(position) {}
string getPosition() { return position; }
void setPosition(string newPosition) { position = newPosition; }
string displayDetails() {
// Write your code here
}
};
Hints for End-of-Chapter Assignments (Programming Projects):
Chapter 1: Programming Project 1:
You may click Exercise01_01 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
Please check your spelling of the words carefully. It is case sensitive. The words are separated by exactly one space.
Chapter 1: Programming Project 2: You may click Exercise01_05 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
Write the math expression as (9.5 * 4.5 - 2.5 * 3) / (45.5 - 3.5).
Chapter 1: Programming Project 3:
You may click Exercise01_11 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
Use 1.0 instead of 1 in your program.
Chapter 1: Programming Project 4:
You may click Exercise01_01Extra to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
In this case, a is 3, b is 4, and c is 5. So, the discriminant for the equation 3x^2 + 4x + 5 is 4 * 4 - 4 * 3 * 5.
Chapter 1: Programming Project 5:
You may click Exercise01_02Extra to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
The values for v0, v1, and t are given. Use these values in the formula to compute the average acceleration.
Chapter 2: Programming Project 1:
You may click Exercise02_05 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
All variables are of the double type.
Step 1: Prompt the user to enter subtotal and gratuity rate into variables subtotal and gratuityRate. Note the gratuityRate is in percent.
For example, if it is 15%, you enter 15 as the input for gratuityRate.
Step 2: Compute gratuity: gratuity = subtotal * gratuityRate / 100.
Step 3: Compute total: total = subtotal + gratuity.
Step 4: Display gratuity and total. Note you need to first display gratuity and then total. For all the programming projects, please pay attention to output order.
Chapter 2: Programming Project 2:
You may click Exercise02_07 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
You must use the int type for all variables in this program. Please note that the % operator only works for integers in C++. See LiveExample 2.7 in Section 2.8.3 for reference.
Now, the key to solve this problem is to use the correct math.
Step 1: Prompt the user to enter the minutes.
Step 2: Get the totalNumberOfDays from the minutes (i.e., totalNumberOfDays = minutes / (24 * 60)).
Step 3: Get the numberOfYears from the numberOfDays (i.e., numberOfYears = numberOfDays / 365).
Step 4: Get the remainingNumberOfDays from totalNumberOfDays (i.e., remainingNumberOfDays = totalNumberOfDays % 365).
Chapter 2: Programming Project 3:
You may click Exercise02_15 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
All variables are of the double type.
Step 1: Prompt the user to enter two points. Each point has two values for x- and y-coordinates.
Step 2: Compute the distance using the distance formula given in the problem description. The correct formula for computing the
distance is pow((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1), 0.5)
Step 3: Display the result.
Chapter 2: Programming Project 4:
You may click Exercise02_19 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
All variables are of the double type.
Step 1: Prompt the user to enter three points. Each point has two values for x- and y-coordinates.
Step 2: Compute side1, side2, and side3 using the distance formula given in the preceding problem description.
Step 3: Compute area using the formula given in the problem description.
Step 4: Display the result.
Chapter 2: Programming Project 5:
You may click Exercise02_23 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
The annualInterestRate (double) is entered in percentage. In the formula, you need to use monthlyInterestRate (double),
which is annualInterestRate / 1200. See LiveExample 2.11 in Section 2.14 for reference.
Chapter 3: Programming Project 1:
You may click Exercise03_01 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
The description of this programming project refers to Programming Exercise 3.1 in the book. Programming Exercise 3.1 can be found in the Programming Exercises section
at the end of this chapter. If you have trouble to find Programming Exercise 3.1, click here to watch this video.
Hint:
All variables are of the double type.
Step 1: Prompt the user to enter a, b, c. The numbers are double.
Step 2: Compute discriminant.
Step 3: if (discriminant < 0), display "The equation has no real roots".
Step 4: else if (discriminant == 0), compute and display one root.
Step 5: else compute and display two roots.
Common errors from this project: In Step 1, your code should read in double values. In Step 2, discriminant is discriminant = b * b - 4 * a * c. In Step 5, please note that root1 is r1 = (-b + discriminant ** 0.5) / (2 * a). Another common mistake is to compute the roots before the if statement. Please compute roots in Step 5.
Chapter 3: Programming Project 2:
You may click Exercise03_03 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
All variables are of the double type.
Step 1: Prompt the user to enter a, b, c, d, e, f. The numbers are double.
Step 2: Compute detA = a * d - b * c.
Step 3: if (detA == 0), display "The equation has no solution".
Step 4: else compute x and y, and display the result.
Common errors from this project: A common mistake is to compute x and y before the if statement. Please compute x and y in Step 4.
Chapter 3: Programming Project 3:
You may click Exercise03_09 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
Prompt the user to enter year (int) and test if year is a leap year.
To test if a year is a leap year, see Section 3.11.
Chapter 3: Programming Project 4:
You may click Exercise03_33 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
Prompt the user to enter year, month, and dayOfMonth. Note that all input are integers. You need to adjust year and month as follows:
if month is 1, set month = 13 and year = year - 1.
if month is 2, set month = 14 and year = year - 1.
You can now use Zeller's formula to compute h.
Chapter 3: Programming Project 5:
You may click Exercise03_19 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
All the input are double.
A point (x, y) is in the circle centered at (0, 0) with radius 10 if the distance to the center is <= 10.
Chapter 4: Programming Project 1:
You may click Exercise04_05 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
Step 1: Prompt the user to enter numberOfSides as an int.
Step 2: Prompt the user to enter the length of a side as a double.
Step 3: Use the formula to compute the area. Use 3.14159 for PI.
Step 4: Display the result.
Chapter 4: Programming Project 2:
You may click Exercise04_11 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
Step 1: Prompt the user to enter an uppercase letter named uppercase.
Step 2: If the input is indeed an uppercase letter, convert it to a lowercase using
int offset = 'a' - 'A';
char lowercase = uppercase + offset;
Display lowercase letter.
Step 3: else an invalid input.
Chapter 4: Programming Project 3:
You may click Exercise04_13 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
Step 1: Prompt the user to enter a character for a hex digit into char hex.
Step 2: Use a multi-way if statement or a switch statement to obtain the corresponding binary string based on the hex value.
Step 3: Display the result.
Chapter 4: Programming Project 4: You may click Exercise04_19 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
When you display the result, print the three cities in one line, separated by exactly one space.
Chapter 4: Programming Project 5:
You may click Exercise04_23 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
You will need to use s.length() and isdigit(ch) function in the program.
Step 1: Prompt the user to enter a string ssn for SSN.
Step 2: Declare a boolean variable named isValid and assign the conjunction of the following to isValid:
The length of ssn is exactly 11.
The character at index 0, 1, 2 of string ssn are digits.
The character at index 3 of string ssn is '-'.
The character at index 4, 5 of string ssn are digits.
The character at index 6 of string ssn is '-'.
The character at index 7, 8, 9 of string ssn are digits.
Step 3: Display the result based on the value of isValid.
Chapter 5: Programming Project 1:
You may click Exercise05_01 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
Step 1: Declare and initialize variables. Your program needs to count the number of positives, number of negatives, and total.
Think about what initial values are appropriate for these variables. Note that the average can be computed using total / (numberOfPositives + numberOfNegatives).
Step 2: Prompt the user to read a number into variable number.
Step 3: Write a while loop to do the following:
Step 3.1: the loop continuation condition is (number =! 0)
Step 3.2: If number > 0, increase numberOfPositives by 1; if number < 0, increase numberOfNegatives by 1.
Step 3.3: Add number to total.
Step 3.4: Prompt the user to a new input and assign it to number.
Step 4: After the loop is finished, if (numberOfPositives + numberOfNegatives == 0),
this means "No numbers are entered except 0". Your program should display exactly this message. Otherwise, display the number of positives,
negatives, and average. To compute average, use 1.0 * total / (numberOfPositives + numberOfNegatives).
Chapter 5: Programming Project 2:
You may click Exercise05_41 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
Maintain two variables (int), max and count. max stores the current max number and count stores its occurrences.
Initially, assign the first number to max and 1 to count. Compare each subsequent number with max. If the number is greater than max, assign it to max and reset count to 1. If the number is equal to max, increment count by 1
Step 1: Declare two integer variables max and count. count is initialized to 0.
Step 2: Read the first number and assign it to max.
Step 3: Write a loop that continues to read an integer. When the integer is 0, the loop ends.
Step 4: For each integer read, if the integer is greater than max, assign it to max and reset count to 1, else if the integer is equal to max, increase count by 1.
Step 5: After the loop is finished, display max and count as shown in the sample run.
Chapter 5: Programming Project 3:
You may click Exercise05_11 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
Note that we assume that the number of students is at least 2. So, your program does not need to consider the case for one or no students.
How would you write this program?
Step 1: Prompt the user to read the number of the students into variable numberOfStudents.
Step 2: Prompt the user to read first student name into student1 (String).
Step 3: Prompt the user to read first student score into score1 (double).
Step 4: Prompt the user to read second student name into student2 (String).
Step 5: Prompt the user to read second student score into score2 (double).
Step 6: If (score1 < score2), swap student1 with student2 and score1 with score2. Throughout the program,
we will use student1 and score1 to store the student name and score with the highest score and student2
and score1 to store the student name and score with the second highest score.
Step 7: Now write a loop to read the next student name and score. Consider the following cases:
Step 7.1: if (score > score1), assign score1 to score2 and score to score1, student1 to student2 and name to student.
Step 7.2: else if (score1 > score2), assign score to score2 and name to student2.
Step 8: Display the top two students' name and score.
Chapter 5: Programming Project 4:
You may click Exercise05_23 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
For this program, you need to use the formula for computing monthlyPayment and totalPayment in Section 2.14.
How would you write this program?
Step 1: Prompt the user to read loanAmount (double) and numberOfYears (int).
Step 2: Print the header using iomanip, "Interest Rate", "Monthly Payment", "Total Payment";
Step 3: Write a for loop as follows:
Step 3.1: The initial action is to declare and initialize annualInterestRate to 5.0.
Step 3.2: The loop continuation condition is <= 8.0.
Step 3.3: The action after each iteration is annualInterestRate += 1.0/ 8.
Step 3.4: In the loop body, compute monthlyPayment and totalPayment using the formula.
Note the monthlyInterestRate is annualInterestRate / 1200. Display annualInterestRate, monthlyPayment, and
totalPayment in one line using iomanip to format the output. Please note: in the first column, you need to
put three digits after the decimal point. For example, 5.000% is correct, but 5% is wrong.
Chapter 5: Programming Project 5:
You may click Exercise05_49 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
Step 1: Declare and initialize variables numberOfVowels and numberOfConsonants with 0 (int).
Step 2: Prompt the user to enter a string.
Step 3: For each character in the string, do the following:
Step 3.1: Convert the character to uppercase.
Step 3.2: If the character is 'A', 'E', 'I', 'O', or 'U', increase numberOfVowels by 1.
Step 3.3: else if the character is a letter, increase numberOfConsonants by 1.
Step 4: Display the result using the wording as shown in the sample output.
Chapter 5: Programming Project 6:
You may click Exercise05_53 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
Step 1: Prompt the user to enter a string s.
Step 2: Declare a bool variable isValid, initialized it with true.
Step 3: Check if every character in s is a digit or character. If not, assign isValid false.
Step 4: Check if the size of s is less than 8. If so, assign isValid false.
Step 5: Count the number of the digits in s. If the count is less than 2, assign isValid false.
Step 6: Now display valid password or invalid password based on the value of isValid.
Chapter 6: Programming Project 1:
You may click Exercise06_07 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
The program has two functions: the main function and the futureInvestmentValue function.
Step 1: Implement the futureInvestmentValue function to compute the futureInvestment value from investmentAmount,
monthlyInterestRate and years using the formula from Exercise 2.23 in Chapter 2. This function return futureInvestmentValue.
Step 2: Implement the main function as follows:
Step 2.1: Prompt the user to enter investmentAmount (double) and annualInterestRate (double).
Step 2.2: Write a for loop as follows: for each year from 1 to 30, display year and the result from invoking futureInvestmentValue(investmentAmount, annualInterestRate / 1200, year). You need to use iomanip to display formatted output.
Chapter 6: Programming Project 2:
You may click Exercise06_13 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
The program has two functions: the main function and the m(int i) function.
Step 1: Implement the m(int i) function to return the summation as shown in the formula for m(i) given in the description.
Step 1.1: declare and initialize pi with 0 and declare and initialize sign with 1.
Step 1.2: for each k from 1 to i, add sign / (2 * k - 1.0) to pi. Note we are using 1.0 rather than 1 to obtain a double result. Change sign using sign = -1 * sign.
Step 1.3: return 4 * pi.
Step 2: Implement the main function as follows:
Step 2.1: Display the header of the table using iomanip. The header is "i m(i)".
Step 2.2: Write a loop as follows: i is initially 1, display i and the result from invoking m(i) using iomanip.
The result of m(i) is displayed with four digits after the decimal point. So, 4 should be displayed 4.0000.
Step 2.3: Increment i by 100.
Step 2.4: Continue the loop if i is less than 1000.
Chapter 6: Programming Project 3:
You may click Exercise06_33 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
The program has two functions: the main function and the solveEquation function.
void solveEquation(double a, double b, double c, double d,
double e, double f, double& x, double& y, bool& isSolvable)
Step 1: Implement the solveEquation function to compute isSolvable, x, and y. Please note that this function should not print anything.
Step 1.1: set isSolvable to false if (a * d - b * c) is 0; true otherwise.
Step 1.2: if isSolvable, compute x and y.
Step 2: Implement the main function. Prompt the user to read input a, b, c, d, e, f. Declare bool variable isSolvable,
and double variables x and y. Invoke solveEquation. If isSolvable, display x and y;
otherwise display "The equation has no solution".
Please note you have to declare an array using a constant size. For all the Programming Projects,
assume that the maximum number of elements in the array is 100.
Chapter 6: Programming Project 4:
You may click Exercise06_39 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
Please read Section 6.14. Section 6.14 gives a program that converts a hex number to a decimal. This program is to convert a
binary to decimal. These two programs are very similar. You just have to make small changes. The radix for hex number 16, but
radix for binary number is 2 for this program.
Chapter 6: Programming Project 5:
You may click Exercise06_41 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
Please read Section 5.12.3. Section 5.12.3 gives a program that converts a decimal to hex. This program is to convert a
decimal to binary. These two programs are very similar. You just have to make small changes. The radix for hex number 16, but
radix for binary number is 2 for this program.
Chapter 7: Programming Project 1:
You may click Exercise07_01 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
Assume the maximum number of students is 100.
Step 1: Declare an array for scores (double) with the size 100.
Step 2: Declare and initialize variable best to keep the best score. Set the initial value to 0.
Step 3: Prompt the user to enter the scores in a loop that executes numberOfStudents times. For each score entered, store it in scores[i]. Compare it with best. If it is greater than best, assign it to best.
Step 4: Write a for loop for i from 0 to numberOfStudents - 1, compare scores[i] with grade to assign the grade for the student.
Chapter 7: Programming Project 2:
You may click Exercise07_03 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
Step 1: Declare an array for counts (int) with size 100. count[0] will store the number of 1s entered and count[99] will store the number of 100 entered. By default, the count[i] is 0.
Step 2: Read a number.
Step 3: Write a while loop:
Step 3.1: The loop continuation condition is (number != 0).
Step 3.2: if number is between 1 and 100, count[number - 1]++.
Step 3.3: read the number again.
Step 4: Write a for loop to display the result as follows:
Step 4.1: for i from 0 to 99
Step 4.2: if counts[i] >= 1, display number i + 1, counts[i]. If (counts[i] > 1), displays "times".
If (counts[i] == 1), display "time". Note if counts[i] is 0, the corresponding number is not displayed.
Chapter 7: Programming Project 3:
You may click Exercise07_05 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
Step 1: Declare an array for numbers with size 10.
Step 2: Declare and initialize an int variable numberOfDistinctValues.
Step 3: Write a for loop to executed 10 times. Each iteration of the loop performs the following actions:
Step 3.1: Read an int value.
Step 3.2: Test if value is already in numbers.
Step 3.3: if value is not numbers, add value to numbers: numbers[numberOfDistinctValues] = value.
Step 3.4: Increase numberOfDistinctValues by 1.
Step 4: Display the output: display numberOfDistinctValues and all the elements in numbers.
For Step 3.2, you may write a function
bool isInNumbers(int numbers[], int size, int value)
This function return true if value is equal to numbers[0], numbers[1], …, or numbers[size -1].
Chapter 7: Programming Project 4:
You may click Exercise07_11 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
Step 1: Implement the mean(const double x[], int size) function as follows:
Step 2.1: Declare and initialize a double variable sum.
Step 2.2: Write a loop to all elements in array x into sum.
Step 2.3: Return sum / size;
Step 2: Implement the deviation(const double x[], int size) function as follows:
Step 2.1: Declare and initialize squareSum.
Step 2.2: Write a loop. For each element x[i], add (x[i] - mean(x)) ^ 2 to squareSum.
Step 2.3: return sqrt(squareSum / (x.length - 1))
Step 3: Implement the main function as follows:
Step 3.1: declare an array numbers with 10 elements (double).
Step 3.2: Prompt the user to enter 10 numbers and store them in numbers.
Step 3.3: Invoke mean(numbers, 10) and deviation(numbers, 10) to obtain mean and deviation for numbers.
Chapter 7: Programming Project 5:
You may click Exercise07_27 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
Assume that the maximum number of the integers in the list is 100. So declare array of size 100.
How would you write this program? Here are some hints:
Step 1: Implement the isSorted(const int list[], int size) function as follows:
Step 1.1: Write a for loop: for i from 0 to size - 1, if (list[i] > list[i + 1]), return false.
Step 1.2: If nothing is return in the for loop, return true after the for loop.
Step 2: Implement the main function as follows:
Step 2.1: Create list using with 100 elements (int).
Step 2.2: Prompt the user to enter the list size and prompt the user to enter int values for list. Please note that list size is less than or equal to 100.
If your input for the program is
Enter the size of the list: 8
Enter list: 10 1 5 16 61 9 11 1
The size of the list is 8.
Step 3: Invoke isSorted(list, size) to test if the elements in list are sorted.
Chapter 8: Programming Project 1:
You may click Exercise08_01 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
Step 1: Implement the sumColumn(const double m[][SIZE], int rowSize, int columnIndex) function as follows:
Step 1.1: Declare and initialize sum.
Step 1.2: Write a for loop: for (int i = 0; i < rowSize; i++), add m[i][columnIndex] to sum. Note: rowSize is 3.
Step 1.3: Return sum.
Step 2: Implement the main function as follows:
Step 2.1: Declare a two-dimensional array double m[3][4] (double).
Step 2.2: Write a nested for loop to obtain the input into m.
Step 2.3: Write a for loop: for (int j = 0; j < SIZE; j--) and invoke sumColumn(m, j) and display it. Note: column size is 4.
Make sure you use the correct row and column size. The matrix has 3 rows and 4 columns. If row/column size is incorrect, your output is unpredictable. Your code may pass CheckExerciseTool even though it is incorrect due to the unpredictable nature. Please see CheckPoint 8.3.1 and 7.2.12 for examples.
Chapter 8: Programming Project 2:
You may click Exercise08_05 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
Step 1: Implement the addMatrix(const double a[][N], const double m2[][N], double c[][N]) function as follows:
Step 1.1: Write a nested for loop to assign a[i][j] + b[i][j] to c[i][j].
Step 2: Implement the printResult(const double m1[][N], const double m2[][N], const double m3[][N], char op) function as follows:
Step 2.1: For each row i from 0 to m1.length - 1, display a row in m1, m2, and m3. In the middle row, display the op between m1 and m2 and display the = symbol between m2 and m3.
Step 3: Implement the main function as follows: (numbers are double)
Step 3.1: Declare array m1. Enter input for m1.
Step 3.2: Declare array m2. Enter input for m2.
Step 3.3: Declare array m3. Invoke addMatrix(m1, m2, m3).
Step 3.4: Display the result by invoking printResult(m1, m2, m3)
Chapter 8: Programming Project 3:
You may click Exercise08_25 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
Step 1: Define two functions:
bool isMarkovMatrix(const double m[][SIZE] a) and
a main function
Step 2: Implement bool isMarkovMatrix(const double m[][SIZE] a) to test if the array is Markov array.
Step 3: Implement the main function.
Step 3.1: Declare the array for the array.
Step 3.2: Prompt the user to enter the array.
Step 3.3: Invoke isMarkovMatrix(a) function to return a boolean value.
Step 3.4: Display the result.
Chapter 8: Programming Project 4:
You may click Exercise08_23 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
Step 1: Implement the main function.
Step 1.1: Set MAX_NUMBER_OF_CITIES to 20. Create cities using double cities[MAX_NUMBER_OF_CITIES][2].
Step 1.2: Prompt the user to enter numberOfCities.
Step 1.3: Prompt the user to enter the coordinates for the cities.
Step 1.4: Declare minTotal (double) and minIndex (int) to store the minimum total distance and the index of the minimum total distance city.
Step 1.5: For every city with index i, invoke totalDistance(cities, i) to return the totalDistance. If it is < minTotal, assign totalDistance to minTotal and i to minIndex.
Step 1.6: Display the minTotal and minIndex for the central city.
Step 2: Implement getDistance(const double c1[], const double c2[]). This function returns the distance between (c1[0], c1[1]) and (c2[0], c2[1]).
Step 3: Implement totalDistance(const double cities[][2], int numberOfCities, int i). This function returns the total distance from city i to all other cities.
Chapter 9: Programming Project 1:
You may click Exercise09_01 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Please note that you have to put all code in one file in order to submit to REVEL. To combine the .h, .cpp, and the main function in one file,
see FAQ Q2 from https://liangcpp.pearsoncmg.com/faq.html.
Here is a template for this program:
#include <iostream>
using namespace std;
class Rectangle
{
// Data members
private:
double width, height;
public:
// Constructor
Rectangle();
// Constructor
Rectangle(double newWidth, double newHeight);
double getWidth();
double getHeight();
double getArea();
double getPerimeter();
};
// Write your code to implement the Rectangle class
int main()
{
// Write your code here
return 0;
}
Chapter 9: Programming Project 2:
You may click Exercise09_11 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Please note that you have to put all code in one file in order to submit to REVEL. To combine the .h, .cpp, and the main function in one file, see FAQ Q2.
Here is a template for this program:
#include <iostream>
using namespace std;
class EvenNumber
{
public:
// No-arg constructor
EvenNumber();
// Constructor
EvenNumber(int newValue);
int getValue();
EvenNumber getNext();
EvenNumber getPrevious();
// Data members
private:
int value;
};
// Implement the class
int main() {
EvenNumber t(16);
cout << t.getValue() << endl;
cout << t.getNext().getValue() << endl;
cout << t.getPrevious().getValue() << endl;
return 0;
}
Chapter 10: Programming Project 1:
You may click Exercise10_01 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
Step 1: Implement the main() function as follows:
Step 1.1: Read string s1.
Step 1.2: Read string s2.
Step 1.3: Invoke isAnagram(s1, s2) to test if s1 and s2 are anagrams.
Step 2: Implement the isAnagram(s1, s2) function as follows:
Step 2.1: If s1 and s2 have different sizes, return false.
Step 2.2: Sort s1 and s2 and return true if they are the same.
Step 3: Implement the sort(string& s) function to sort a string. Refer to SelectionSort in Section 7.10. The code in Section 7.10 sorts an array.
Modify it to sort characters in the string.
Chapter 10: Programming Project 2:
You may click Exercise10_13 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Please note that you have to put all code in one file in order to submit to REVEL. To combine the .h, .cpp, and the main function in one file, see FAQ Q2.
Chapter 11: Programming Project 1:
You may click Exercise11_11 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Use the template to complete your code.
Chapter 12: Programming Project 1:
You may click Exercise12_13 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Use the template to complete your code.
Study the code in Listing 12.12 EvaluateExpression.cpp using some samples, for example, 1+2, 2 * 3 - 3, etc.
Modify the example EvaluateExpression.cpp incrementally. Once step at a time and you will know which step you are struggling.
Step 1. The operator % can be implemented similar to the * and / operators. Add the code for processing % in lines 92-103 in Listing 12.12.
Step 2. The operator ^ has the highest precedence. However, note that the ^ operator is right-associative, meaning that 2 ^ 3 ^ 2 is same as 2 ^ (3 ^ 2). In lines 92-103 in Listing 12.12, the program processes the * and / operators, add the code for processing the ^ operator after this block.
Chapter 12: Programming Project 2:
You may click Exercise12_23 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
In order to test if a 2-d array contains consecutive four equal values, we define a function to test if a vector contains
consecutive four equal values:
bool isConsecutiveFour(const vector<int> values)
Implement bool isConsecutiveFour(const vector<vector<int>>& values) as follows:
Step 1. Check rows. For each row, invoke isConsecutiveFour(const vector<int> values) to test if it
contains consecutive four equal values.
Step 2. Check columns. For each column, poll the values from a column into a vector. Invoke isConsecutiveFour(const vector<int> values) to test if it
contains consecutive four equal values.
Step 3. Check major diagonals. For each major diagonal, poll the values from a diagonal into a vector. Invoke isConsecutiveFour(const vector<int> values) to test if it
contains consecutive four equal values.
Step 4. Check sub-diagonals. For each sub-diagonal, poll the values from a diagonal into a vector. Invoke isConsecutiveFour(const vector<int> values) to test if it
contains consecutive four equal values.
Chapter 12: Programming Project 3:
You may click Exercise12_31 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
You may define a new function
template<typename T>
int indexOf(const vector<T> v, T name)
This function returns the index of the first element in vector v that matches name. If no match, returns -1.
Implement intersection(const vector<T>& v1, const vector<T>& v2) as follows:
Step 1: Declare result as an empty vector.
Step 2: Write a loop, for each element in v1, test if it is in v2 using the indexOf function. If it is in v2, add it to result.
Finally, return result after the loop.
Chapter 13: Programming Project 1: Exercise13_03
You can test your code using the following two cases. Verify that you read each number correctly and the total count is correct.
Case 1. Suppose the file Exercise.txt contains numbers 3 9\n 8. The sample run of the program is shown as follows:
Total is 20
Average is 6.66667
Case 2. Suppose the file Exercise.txt contains numbers 1\n 2 3. The sample run of the program is shown as follows:
Total is 6
Average is 2.0
Chapter 13: Programming Project 2: Exercise13_01
Due to my server security restriction, the user is not allowed to read/write files on the server. You cannot test this program from CheckExercise. However, you can verify it before submitting the REVEL. After your program is executed, check Exercise13_1.txt. The file should contain 0 1 2 3 4 5 6 ... 93 94 95 96 97 98 99 at the end.
Chapter 14: Programming Project 1:
You may click Exercise14_07 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Use the code template from the project description to complete the exercise.
Chapter 14: Programming Project 2:
You may click Exercise14_11 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Use the code template from the project description to complete the exercise.
Chapter 15: Programming Project 1:
You may click Exercise15_03 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Use the code template from the project description to complete the exercise.
Chapter 16: Programming Project 1:
You may click Exercise16_01 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Use the code template from the project description to complete the exercise.
Chapter 16: Programming Project 2:
You may click Exercise16_05 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Use the code template from the project description to complete the exercise.
Chapter 17: Programming Project 1:
You may click Exercise17_03 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
The program contains the main function and the gcd(int m, int n). The main function prompts the user for the input m and n.
It then invokes gcd(m, n) to return the GCD of m and n.
gcd(m, n) returns n
if m % n is 0. Otherwise, gcd(m, n) is return gcd(n, m % n).
Chapter 17: Programming Project 2:
You may click Exercise17_11 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
The program contains the main function and the sumDigits(long n). The main function prompts the user for the input number n. It then invokes sumDigits(n) to return the sum of the digits in n.
sumDigits(n) returns n if n is a single digit. Otherwise, it returns sumDigits(n / 10) + sumDigits(n % 10). n % 10 is the last digit in n. n / 10 is the remaining number after removing the last digit.
Chapter 17: Programming Project 3:
You may click Exercise17_15 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
The program contains the main function and two overloaded count functions. The main function prompts the user for the input string and then a character. It then invokes the count(const string& s, char a) function.
The count(const string& s, char ch) function invokes count(s, ch, s.length() - 1).
The count(s, ch, high) is a recursive helper function. The function returns 0 if high < 0. Otherwise, it returns count(s, ch, high - 1) + (s[high] == ch ? 1 : 0).
Your program may look like this:
#include <iostream>
#include <string>
using namespace std;
int count(const string& s, char a, int high)
{
// Write your code here
}
int count(const string& s, char a)
{
// Write your code here
}
int main()
{
// Write your code here
}
Chapter 17: Programming Project 4:
You may click Exercise17_21 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
For simplicity, you can assume that the decimal integer is greater than 0. Your submission will work with this assumption.
The program contains the main function and the decimalToBinary function. The main function prompts the user to enter an integer then invokes the decimalToBinary(int) to return a binary string for the integer. It displays the binary string.
The decimalToBinary(int value) function returns "" if value is 0, otherwise, it returns decimalToBinary(value / 2) + (value % 2 == 0? "0" : "1").
Note that decimalrBinary(value / 2) returns a string. value % 2 is 0 or 1.
Chapter 17: Programming Project 5:
You may click Exercise17_23 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
The program contains the main function and the binaryToDecimal(const string& binaryString) function.
The main function prompts the user to enter a binary string then invokes the binaryToDecimal(binaryString) to return
a decimal integer. It displays the integer.
We define a helper function
int binaryToDecimal(const string& binaryString, int low, int high)
The helper function returns 0 if high < low, else
returns binaryToDecimal(binaryString, low, high - 1) * 2
+ (binaryString[high] - '0');
Chapter 18: Programming Project 1:
You may click Exercise18_01 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
The program contains the main function and the maxConsecutiveSortedSubstring function.
string maxConsecutiveSortedSubstring(const string& s)
Implement the maxConsecutiveSortedSubstring function as follows:
Create a vector:
vector<int> maxConsecutiveLength(s.length());
Compute the length of the max consecutive subsequence starting at index i for every i and save it in
maxConsecutiveLength[i].
Chapter 18: Programming Project 2:
You may click Exercise18_03 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
The program contains the main function and the match function.
int match(const string s, const string pattern)
Implement the match function as follows:
Compare pattern with the substring in s starting from index 0. If a mismatch occurs at index i in s, slide the pattern past the mismatched character in s and continue to compare the
pattern with the substring in s.
Chapter 18: Programming Project 3:
You may click Exercise18_05 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Correction:
The Sample Run should be
Enter a series of numbers ending with 0: 2 4 4 8 8 8 8 2 4 4 0
The longest same number sequence starts at index 3 with 4 values of 8
Hint:
Introduce the variables:
int longestSequenceCount = 0;
int longestSequenceValue = 0;
int longestSequenceIndex = 0;
Use these variables to track the longest sequence count, longest sequence value, and the starting index for the longest sequence.
Write a loop to read the input and update these variables.
Chapter 19: Programming Project 1:
You may click Exercise19_03 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
Modify the QuickSort program in Section 19.5 using template.
Chapter 20: Programming Project 1:
You may click Exercise20_07 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
Use the code template from the project description to complete the exercise.
Chapter 20: Programming Project 2:
You may click Exercise20_11 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
Use the code template from the project description to complete the exercise.
Chapter 21: Programming Project 1:
You may click Exercise21_03 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
Use the code template from the project description to complete the exercise.
Chapter 21: Programming Project 2:
You may click Exercise21_09 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
Use the code template from the project description to complete the exercise.
Chapter 22: Programming Project 1:
You may click Exercise22_01 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
Use the code template from the project description to complete the exercise.
Chapter 23: Programming Project 1:
You may click Exercise23_01 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
Use the code template from the project description to complete the exercise.
Chapter 23: Programming Project 2:
You may click Exercise23_11 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
Use the code template from the project description to complete the exercise.
Chapter 24: Programming Project 1:
You may click Exercise24_09 to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
Use the code template from the project description to complete the exercise.
Chapter 25: Programming Project 1:
You may click Exercise25_01Extra to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
Use the code template from the project description to complete the exercise.
Chapter 26: Programming Project 1:
You may click Exercise26_01Extra to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
Use the code template from the project description to complete the exercise.
Chapter 26: Programming Project 2:
You may click Exercise26_02Extra to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Use the code template from the project description to complete the exercise.
Chapter 27: Programming Project 1:
You may click Exercise27_01Extra to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
Use the code template from the project description to complete the exercise.
Chapter 27: Programming Project 2:
You may click Exercise27_02Extra to use the CheckExerciseTool to check and debug your code in addition to getting feedback from Revel.
Hint:
Use the code template from the project description to complete the exercise.