Problem Solving with C++ (9th Edition)
9th Edition
ISBN: 9780133591743
Author: Walter Savitch
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Chapter 9, Problem 5PP
Program Plan Intro
Computer Lab Logging
Program Plan:
- Include the necessary libraries.
- Use namespace.
- Define the constants and type definition.
- Define the function prototypes.
- Define the function “createArrays()” to create the dynamic array for the lab.
- Declare the variables.
- Define the first array which is the array of labs.
- Define the second array which defines the size of the lab.
- Define the function “freeArrays()” to release the allocated memory.
- Define the function “showLabs()” to display the status of all labs.
- Define the function “login()” to simulate the user login.
- Declare the required variables.
- Get input from the keyboard, validating data ranges.
- Use a while loop to repeat operation until user requires.
- Store the value and display the message.
- Finally, assign that station to the user.
- Define the function logoff() to logoff that user.
- Declare the required variables.
- Get input from keyboard, validating data ranges.
- Use a while loop to repeat operation until user requires.
- Store the value and display the message.
- Use a for loop to repeat operation until user requires.
- Display the message of the user logged in.
- Otherwise display that user is not logged in.
- Define the function “search()” to search that user.
- Declare the required variables.
- Get input from keyboard, validating data ranges.
- Use a while loop to repeat operation until user requires.
- Store the value and display the message.
- Use a for loop to repeat operation until the user is found out.
- Otherwise display that user is not logged in.
- Define the main method.
- Declare the variables that are required for program.
- Initialize lab sizes to those given in the problem.
- Create a ragged array structure.
- Use a while loop to repeat operation until user requires.
- Perform login, logoff or search function.
- Free memory before exiting.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
From an ATM, a user may withdraw up to $500 every day. The service fee is 4% if a
consumer withdraws more than $300. It alerts the customer of insufficient cash and
offers to withdraw the funds for a $25 charge. If your account has a negative balance or
is empty, you won't be able to withdraw money from the ATM. The ATM notifies the user
of the maximum withdrawal amount and refuses the transaction if it exceeds $500.
Create a withdrawal amount entry algorithm that clients may use. After checking the
account balance, the algorithm debits the customer's account for the amount withdrawn
plus any applicable service charges.
User accounts on a computer network require passwords that contain 6 characters: The first character must be an upper-case letter (A-Z), the last character must be a digit (0-9), and the 4 middle characters can be either a lower-case letter (a-z), upper-case letter, or a digit. How many passwords are
possible is allowed (repetition of characters is allowed based on the given requirements)? Enter your answer in the box below.
Answer =
You run four computer labs. Each lab contains computer stations that are numbered as
shown in the table below:-
Lab Number Computer Station Numbers
1
1-5
2
1-6
3
1-4
4
1-3
Each user has a unique five-digit ID Number. Whenever a user logs on, the user's ID,
Lab Number, and the computer station are transmitted to your station. For example, if
user 49193 logs onto station 2 in Lab 3, your system receives (49193, 2, 3) as input
data. Similarly, when a user logs off a station, your system receives the Lab Number
and computer station number.
Write a computer program that could be used to track, by lab, which user is logged onto
which computer. For example, if user 49193 is logged into station 2 in lab 3 and user
99577 is logged into station 1 of lab 4, then your system might display the following:-
Lab Number
Computer Stations
1
1: empty 2: empty 3: empty 4: empty 5: empty
1: empty 2: empty 3: empty 4: empty 5: empty 6: empty
3
1: empty 2: 49193 3: empty 4: empty
4
1:99577 2: empty 3: empty…
Chapter 9 Solutions
Problem Solving with C++ (9th Edition)
Ch. 9.1 - Prob. 1STECh. 9.1 - Prob. 2STECh. 9.1 - Give at least two uses of the operator. State...Ch. 9.1 - Prob. 4STECh. 9.1 - Prob. 5STECh. 9.1 - Suppose a dynamic variable were created as...Ch. 9.1 - Write a definition for a type called NumberPtr...Ch. 9.1 - Prob. 8STECh. 9.2 - Write a type definition for pointer variables that...Ch. 9.2 - Suppose your program contains code to create a...
Ch. 9.2 - Prob. 11STECh. 9.2 - Prob. 12STECh. 9.2 - What is the output of the following code fragment?...Ch. 9.2 - What is the output of the following code fragment?...Ch. 9.2 - What is the output of the following code fragment?...Ch. 9 - Prob. 1PCh. 9 - Write a program that asks the user to input an...Ch. 9 - Palindrome testing with pointers This Practice...Ch. 9 - Do Programming Project 3 in Chapter 7 in this...Ch. 9 - Do Programming Project 11 in Chapter 7 using a...Ch. 9 - Write a function that takes a C string as an input...Ch. 9 - Prob. 5PPCh. 9 - One problem with dynamic arrays is that once the...Ch. 9 - Prob. 7PPCh. 9 - Write a program that outputs a histogram of...
Knowledge Booster
Similar questions
- The process that the public uses to log/register complaints begins with the loading of the complaint on the Online Portal or Mobile App. All loaded complaints will be in the ComplaintLoaded state. Complaints can either be accepted (through the acceptance option) or rejected (through the reject option). All accepted complaints will be in the ComplaintsAccepted state and rejected complaintswill be in the Complaints Rejected State. For both Accepted and Rejected Complaint, there is a send notification option that sends notifications out. The process ends with Notification Sent state for all the notifications that are sent out. The Online Portal or Mobile App has a mechanism to check the details of the complaint before accepting or rejecting Q.3.1 Analyse the process used to log/register complaints and create a state machine diagram.arrow_forwardKroger Co., a large nationwide grocery chain, maintains a customer reward system titled the “Kroger Plus” card. Customers who enroll in this system are entitled to discounts on products at Kroger stores and on gasoline. To earn discounts and other rewards, the shopper must use the “Kroger Plus” card at the time of checkout. The card has a bar code that identifies the customer. This system allows Kroger to determine customer buying patterns and to use the data for data mining. Using a Web search engine, search for “data mining” and “grocery.” In a one (1) page response, describe what types of information grocery stores collect that they can use for data mining purposes. Also, describe how grocery chains use data mining to improve performance.arrow_forwardA Web site validates a 16-digit ID number based on the following rules - 1. Starting with the leftmost digit, double it and then double every other digit after it. However, if any of the doubled digits is a two-digit number, subtract 9 from it. Then sum these new digits. For instance, if the ID card number is 5866793610024475, then the digits considered are 5, 6, 7, 3, 1, 0, 4, 7, their new replacements are 1, 3, 5, 6, 2, 0, 8, 5 and the sum of the replacement is 30. 1 2 3 4 6. 7 8 9 10 11 12 13 14 15 8. 6. 7 9 3 6 1 4 4 7 5 6 7 1 4 7 5*2-9 6*2-9 7*2-9 3*2 1*2 0*2 4*2 7*2-9 =1 =3 =5 =6 =2 =0 =8 =5 2. Sum together the remaining sever digits from the ID card number. That is, the digits in the odd-numbered positions. With the ID card number above, we obtain 8+6+9+6+0+2+4+5 = 40. 3. Add together the two sums. If the result is a multiple of 10, then accept the ID card number. Otherwise, reject it. We accept the ID card number since 30+40=70, a multiple of 10. Write a program that perform…arrow_forward
- A new bank wants to make a simple application to keep track of all accounts and transactions.In this TMA, it is required to help the bank manager implement the required application.Requirements:After a quick meeting with the bank manager, you got the following information: It is required to store all bank accounts in one collection and all the transactions happened in another collection. Each account has a unique account number, a holder and balance. There is a specific prefix (common for all accounts) that should be added to the holder's civil id to create the unique account number. In addition, it is not allowed for a holder to have more than one account.Furthermore, only three transactions are allowed on any account: deposit, withdrawal and transfer money to another account. Each holder has a unique civil ID (national id), a name and other attributes (add at least 2attributes from your choice). For each transaction, it is required to store the account(s) affected, amount of…arrow_forwardA new bank wants to make a simple application to keep track of all accounts and transactions.In this TMA, it is required to help the bank manager implement the required application.Requirements:After a quick meeting with the bank manager, you got the following information: It is required to store all bank accounts in one collection and all the transactions happened in another collection. Each account has a unique account number, a holder and balance. There is a specific prefix (common for all accounts) that should be added to the holder's civil id to create the unique account number. In addition, it is not allowed for a holder to have more than one account.Furthermore, only three transactions are allowed on any account: deposit, withdrawal and transfer money to another account. Each holder has a unique civil ID (national id), a name and other attributes (add at least 2attributes from your choice). For each transaction, it is required to store the account(s) affected, amount of…arrow_forwardSaira owns a small business and she frequently makes transactions. Sometimes she makes payments and other times payments are credited in her account. One of her customer Tania purchased a product and credited payment while another payment by Saira was in progress. Now the sequence of transaction is as follows:1. Tania’s account read amount in saira’s account2. Saira’s account read amount in saira’s account3. Tania added Rs. 500/- in original amount (that was lets suppose Rs. 60,000/ 4. Saira’s account subtracted Rs. 2000/- that she debited in someone else’s account form the original amount (that was Rs. 60,000) 5. Tania’s account committed the transaction 6. Saira’s account committed the transaction Draw the above-mentioned sequence in form of a table and see if there is a problem. What this problem is called and how can we avoid such kind of problem? Propose some solutions (at least two) and then explain which one is better and why?arrow_forward
- The Pizza Ordering System allows the user of a web browser to order pizza forhome delivery. To place an order, a shopper searches to find items to purchase,adds items one at a time to a shopping cart, and possibly searches again for moreitems. When all items have been chosen, the shopper provides a delivery address.If not paying with cash, the shopper also provides credit card information. Thesystem has an option for shoppers to register with the pizza shop. They can thensave their name and address information, so that they do not have to enter thisinformation every time that they place an order.Develop a use case diagram, for a use case for placing an order, PlaceOrder. Theuse case should show a relationship to two previously specified use cases,IdentifyCustomer, which allows a user to register and log in, and PaybyCredit,which models credit card payments.arrow_forwardWrite a script code that creates a user with these properties: 1. Name: eng, ID:1000, GID:1000,and Password:1234 2. If the system creates eng account correctly print a welcome message "Welcome eng". Else print error message. 3. Let the eng to become a member in root group. 4. Let the eng to be able to create and execute any script. 5. Delete the GID=1000;arrow_forwardCourse Title : Operating SystemQuestion : How you will create new user using terminal in Ubuntu? Add screenshots of all steps for new user creation including terminal and Login page in Answer sheet. Every student has to create new user as of his/her arid number for example (18-arid-2929). Note: screenshots are mandatory.arrow_forward
- Powershell Commands Create two groups for two teams in your company (server development) and (software testing). There are 3 members in each team need to create. They are (Jaspreet, Lina and Hanh) for the server development team, and (Nina, David and Rahul) for the software testing team. Each member has to have some role description. Lina temporarily left so her account must be disabled. Rahul left the company to a new job. Lina came back to work so her account must be enabled again. The company decided to change the name of the server development to (software development).arrow_forwardThe Pizza Ordering System allows the user of a web browser to order pizza for home delivery. To place an order, a shopper searches to find items to purchase, adds items one at a time to a shopping cart, and possibly searches again for more items. When all items have been chosen, the shopper provides a delivery address. If not paying with cash, the shopper also provides credit card information. The system has an option for shoppers to register with the pizza shop. They can then save their name and address information, so that they do not have to enter this information every time that they place an order. a. Construct the use case diagram for the above scenarioarrow_forwardAfter executing the following code, a message would be displayed on the screen. What would be the message and it attributes and at which location it would be displayed? MOV CX, 10 MOV AX, 0XB800 MOV ES, AX MOV DI, 810 MOV AX, 0x9230 L1: MOV WORD [ES: DI], AX ADD DI, 2 INC Ax LOOP L1arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Np Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:CengageEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT