Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize the dormitory Health Management system with C++

2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "how C++ realizes the dormitory hygiene management system". In the daily operation, it is believed that many people have doubts about how C++ realizes the dormitory hygiene management system. The editor consulted all kinds of materials and sorted out the simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "how C++ can realize the dormitory hygiene management system". Next, please follow the editor to study!

Introduction:

When I wrote the program, there was a lot of lack of knowledge. I was a half-way monk. At that time, when I saw the goto statement in another textbook, I felt very interesting, so I used it, but the goto statement is not suitable for very long code, because it is easy to cause logic confusion, it can also be replaced with do-while statement.

I designed the output table framework and recycled the output data. To align the data, use setw (), setw (int n) is the field width setting used in the output operation in c + +, set the field width of the output, and n represents the field width. This function is only valid for the following output, and then changes back to the default domain width at the end of the subsequent output. When the length of the following output field is less than n, fill in front of the field with a space; when the length of the output field is greater than n, all are output as a whole. The header file is: iomanip

Input password, such as non-enter keys, all output "*", through the getch () function, this function is a non-echo function, when the user presses a character, the function automatically read, do not need to press the enter key, the header file: conio.h,int _ _ cdecl getch (); declaration, etc., but also use some algorithms, do not introduce in detail here.

I. basic functions

1. (administrator, need password) to achieve score entry (floor hygiene, bed, item placement, etc.) score summation and preservation, modification and deletion

2. (student query) realize to display all dormitory members (sorted by dormitory number and grade), display their dormitory score-input number (sorted by dormitory number and grade), civilized dormitory this week, and bad comment dormitory this week.

Second, expand the function

1. The administrator can also carry out basic management of student dormitory information, including dormitory number and dormitory members, including adding, deleting, querying, changing and other functions.

two。 The system uses members to query and display all dormitory scores (can be sorted by dormitory number or scores), and students can also view other dormitory related information.

The overall functional structure of the system is: first of all, students can view the dormitory health inspection results, the administrator has a unique account number and password, and can add, delete, change and check the basic data after login.

Overall, it is divided into five modules: dormitory basic information input module, dormitory basic information modification module, dormitory basic information query module, dormitory basic information display module, dormitory basic information preservation module.

The code is as follows:

# include#include#include#include#include#define _ CRT_SECURE_NO_WARNINGSusing namespace std;#define M 50amp / watch leader typedef int shu;// dormitory information structure typedef struct {shu ground;// floor hygiene shu bed;// bed shu article;// items display shu other;// other shu grade;// total score char member [50]; / dormitory member char number [10]; / dormitory number int Total } Student, St; Student S [M]; / / 1. Define clear screen function void Clear () {system ("pause"); system ("cls");} / / 2, define display function header void showhead () {cout

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report