0% found this document useful (0 votes)
6 views11 pages

Introduction To C++ Programming and Data Structures 4th Edition Liang Solutions Manual

The document provides information about various educational resources available for instant download at testbankfan.com, including solutions manuals and test banks for multiple editions of programming and other academic subjects. It also outlines a programming project related to a locker puzzle, detailing the problem description, analysis, design, coding, and testing requirements. Additionally, there are mentions of donation compliance and Project Gutenberg's mission in providing free eBooks.

Uploaded by

euniciyanndy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views11 pages

Introduction To C++ Programming and Data Structures 4th Edition Liang Solutions Manual

The document provides information about various educational resources available for instant download at testbankfan.com, including solutions manuals and test banks for multiple editions of programming and other academic subjects. It also outlines a programming project related to a locker puzzle, detailing the problem description, analysis, design, coding, and testing requirements. Additionally, there are mentions of donation compliance and Project Gutenberg's mission in providing free eBooks.

Uploaded by

euniciyanndy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Instant TestBank Access, One Click Away – Begin at testbankfan.

com

Introduction to C++ Programming and Data


Structures 4th Edition Liang Solutions Manual

https://testbankfan.com/product/introduction-to-c-
programming-and-data-structures-4th-edition-liang-solutions-
manual/

OR CLICK BUTTON

DOWLOAD NOW

Get Instant TestBank Download – Browse at https://testbankfan.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Introduction to Programming with C++ 3rd Edition Liang


Test Bank

https://testbankfan.com/product/introduction-to-programming-
with-c-3rd-edition-liang-test-bank/

testbankfan.com

C++ Programming Program Design Including Data Structures


7th Edition Malik Solutions Manual

https://testbankfan.com/product/c-programming-program-design-
including-data-structures-7th-edition-malik-solutions-manual/

testbankfan.com

C++ Programming Program Design Including Data Structures


8th Edition Malik Solutions Manual

https://testbankfan.com/product/c-programming-program-design-
including-data-structures-8th-edition-malik-solutions-manual/

testbankfan.com

Market-Based Management 6th Edition Roger Best Test Bank

https://testbankfan.com/product/market-based-management-6th-edition-
roger-best-test-bank/

testbankfan.com
Essentials of Human Anatomy and Physiology Global 11th
Edition Marieb Test Bank

https://testbankfan.com/product/essentials-of-human-anatomy-and-
physiology-global-11th-edition-marieb-test-bank/

testbankfan.com

Fundamentals of Investments Valuation and Management 7th


Edition Jordan Test Bank

https://testbankfan.com/product/fundamentals-of-investments-valuation-
and-management-7th-edition-jordan-test-bank/

testbankfan.com

Principles of Electronic Communication Systems 4th Edition


Frenzel Test Bank

https://testbankfan.com/product/principles-of-electronic-
communication-systems-4th-edition-frenzel-test-bank/

testbankfan.com

Essentials of Modern Business Statistics with Microsoft


Excel 6th Edition Anderson Solutions Manual

https://testbankfan.com/product/essentials-of-modern-business-
statistics-with-microsoft-excel-6th-edition-anderson-solutions-manual/

testbankfan.com

Psychology 10th Edition Bernstein Test Bank

https://testbankfan.com/product/psychology-10th-edition-bernstein-
test-bank/

testbankfan.com
Wardlaws Perspectives in Nutrition 10th Edition Byrd-
Bredbenner Solutions Manual

https://testbankfan.com/product/wardlaws-perspectives-in-
nutrition-10th-edition-byrd-bredbenner-solutions-manual/

testbankfan.com
Student Name: __________________
Class and Section __________________
Total Points (20 pts) __________________
Due: August 29, 2016 before the class

Project: Locker Puzzle


Armstrong Atlantic State University

Problem Description:
A school has 100 lockers and 100 students. All lockers are closed on the first day of
school. As the students enter, the first student, denoted S1, opens every locker. Then the
second student, S2, begins with the second locker, denoted L2, and closes every other
locker. Student S3 begins with the third locker and changes every third locker (closes it if
it was open, and opens it if it was closed). Student S4 begins with locker L4 and changes
every fourth locker. Student S5 starts with L5 and changes every fifth locker, and so on,
until student S100 changes L100.

After all the students have passed through the building and changed the lockers, which
lockers are open? Write a program to find your answer.

(Hint: Use an array of 100 Boolean elements, each of which indicates whether a locker is
open (true) or closed (false). Initially, all lockers are closed.)

Analysis:
(Describe the problem including input and output in your own words.)

Design:
(Describe the major steps for solving the problem.)

1
Coding: (Copy and Paste Source Code here. Format your code using Courier 10pts)

Testing: (Describe how you test this program)

Submit the following items:

1. Print this Word file and Submit to me before the class on the due day

2. Compile, Run, and Submit to LiveLab as Exercise7_15 (you must submit the program
regardless whether it complete or incomplete, correct or incorrect)

Solution:

#include <iostream>
using namespace std;

int main()
{
// Declare a constant value for the number of lockers
const int NUMBER_OF_LOCKER = 100;

// Create an array to store the status of each array


2
// The first student closes all lockers
bool lockers[NUMBER_OF_LOCKER];
for (int i = 0; i < NUMBER_OF_LOCKER; i++) {
lockers[i] = false;
}

// Each student changes the lockers


for (int j = 1; j <= NUMBER_OF_LOCKER; j++) {
// Student Sj changes every jth clocker
// starting from the lockers[j - 1].
for (int i = j - 1; i < NUMBER_OF_LOCKER; i += j) {
lockers[i] = !lockers[i];
}
}

// Finds which one is open


for (int i = 0; i < NUMBER_OF_LOCKER; i++) {
if (lockers[i])
cout << "Locker " << (i + 1) << " is open" << endl;
}

return 0;
}

3
Random documents with unrelated
content Scribd suggests to you:
small donations ($1 to $5,000) are particularly important to
maintaining tax exempt status with the IRS.

The Foundation is committed to complying with the laws regulating


charities and charitable donations in all 50 states of the United
States. Compliance requirements are not uniform and it takes a
considerable effort, much paperwork and many fees to meet and
keep up with these requirements. We do not solicit donations in
locations where we have not received written confirmation of
compliance. To SEND DONATIONS or determine the status of
compliance for any particular state visit www.gutenberg.org/donate.

While we cannot and do not solicit contributions from states where


we have not met the solicitation requirements, we know of no
prohibition against accepting unsolicited donations from donors in
such states who approach us with offers to donate.

International donations are gratefully accepted, but we cannot make


any statements concerning tax treatment of donations received from
outside the United States. U.S. laws alone swamp our small staff.

Please check the Project Gutenberg web pages for current donation
methods and addresses. Donations are accepted in a number of
other ways including checks, online payments and credit card
donations. To donate, please visit: www.gutenberg.org/donate.

Section 5. General Information About


Project Gutenberg™ electronic works
Professor Michael S. Hart was the originator of the Project
Gutenberg™ concept of a library of electronic works that could be
freely shared with anyone. For forty years, he produced and
distributed Project Gutenberg™ eBooks with only a loose network of
volunteer support.
Project Gutenberg™ eBooks are often created from several printed
editions, all of which are confirmed as not protected by copyright in
the U.S. unless a copyright notice is included. Thus, we do not
necessarily keep eBooks in compliance with any particular paper
edition.

Most people start at our website which has the main PG search
facility: www.gutenberg.org.

This website includes information about Project Gutenberg™,


including how to make donations to the Project Gutenberg Literary
Archive Foundation, how to help produce our new eBooks, and how
to subscribe to our email newsletter to hear about new eBooks.
Welcome to Our Bookstore - The Ultimate Destination for Book Lovers
Are you passionate about testbank and eager to explore new worlds of
knowledge? At our website, we offer a vast collection of books that
cater to every interest and age group. From classic literature to
specialized publications, self-help books, and children’s stories, we
have it all! Each book is a gateway to new adventures, helping you
expand your knowledge and nourish your soul
Experience Convenient and Enjoyable Book Shopping Our website is more
than just an online bookstore—it’s a bridge connecting readers to the
timeless values of culture and wisdom. With a sleek and user-friendly
interface and a smart search system, you can find your favorite books
quickly and easily. Enjoy special promotions, fast home delivery, and
a seamless shopping experience that saves you time and enhances your
love for reading.
Let us accompany you on the journey of exploring knowledge and
personal growth!

testbankfan.com

You might also like