Problem Solving with C++ (9th Edition)
Problem Solving with C++ (9th Edition)
9th Edition
ISBN: 9780133591743
Author: Walter Savitch
Publisher: PEARSON
Question
Book Icon
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.

Blurred answer
Students 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…
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT