Problem Solving with C++, Student Value Edition
Problem Solving with C++, Student Value Edition
10th Edition
ISBN: 9780134543680
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
Topic: Data Communication & Network Write a socket server program named "RockPaperScissorsServer", which communicates with players (clients). Server firstly receives a name for the player. Let’s assume 1 is Rock, 2 is Paper and 3 is Scissors. Next Server receives any of the 3 number from the user, generate a random number between 1 to 3 itself and then apply the Rock Paper Scissors game logic (which is paper beats rock, rock beats scissors, scissors beats paper), Then it will tell the player if the player or server has won. Write another client program to communicate with the server. Kindly make the server in such a way the any time any player can leave and another player can join. Use Java to write the code. *** Reference code: Creating a simple Server *** import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.net.ServerSocket; import java.net.Socket;import java.util.Scanner; public class Server1 {…
You have a group of friends coming to visit for your high school reunion, and you want to take them out to eat at a local restaurant. You are not sure if any of them have dietary restrictions, but your restaurant choices are as follows:   Joe’s Gourmet Burgers—Vegetarian: No, Vegan: No, Gluten-Free: No Main Street Pizza Company—Vegetarian: Yes, Vegan: No, Gluten-Free: Yes Corner Café—Vegetarian: Yes, Vegan: Yes, Gluten-Free: Yes   Write a program that asks whether any members of your party are vegetarian, vegan, or gluten-free, to which then displays only the restaurants to which you may take the group.
The task should be done in a group of max 3   In the program explained during the lab the client sends only 1 message to server ‘hello from tcp client’ server responds with the uppercase message.   Update the program / make a simple chat program so that Client can send/receive multiple messages to server. A special exit message is used to disconnect ‘Exit’. Each time client sends a message, server responds with a confirmation of receiving it and its length (use the screenshots in the presentation as a reference)
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