• Nie Znaleziono Wyników

print – printing all the data of the employee

N/A
N/A
Protected

Academic year: 2021

Share "print – printing all the data of the employee"

Copied!
1
0
0

Pełen tekst

(1)

1. Define and implement a structure of an employee with the following fields: a forename, a surname, a position (being strings) and a salary being a real number. Implement the following methods of the structure:

• the constructor with parameters for the all necessary fields of the employee (some of them may have the default values),

• set & get methods for all the fields of the employee (i.e., getSalary, setSalary, etc.),

• incSalary – increasing the salary of the employee by the value given as a parameter,

• print – printing all the data of the employee.

Test all the structure capabilities – create an array of the employees and let the user manage them.

2. Define the Student structure with the following fields: a forename, a surname (being strings), an index number being an integer number and an array/list of his marks (empty by default, you are allowed to limit the number of students's marks). Implement the following methods of the structure:

• the constructor with parameters for the first three fields of the student with some empty/zero default values,

• set & get methods for the first three fields of the student (i.e., getSurname, setSurname, etc.),

• addMark – adding a new mark (given as a parameter) for the student (check if the mark is correct, e.g. between 2 and 5),

• avgGrade – computing the average grade for the student by calculating the arithmetic mean of his marks,

• print – printing all the data of the student.

Test all the structure capabilities – create an array of the students and let the user manage them.

Cytaty

Powiązane dokumenty

The factorization has been completed, but the factor U is exactly singular, and division by zero will occur if it is used to solve a system of equations... The leading dimensions

(d) Write down the number of customers of Alan’s Diner that were also customers of Pete’s Eats.. A survey of 100 families was carried out, asking about the pets

(d) Find the probability that a student chosen at random from the IB class plays either the clarinet or drums or

If c 2 λ 1 ≤ 1/2, this estimate is contained in the Kuz’min–Landau inequality; otherwise, the estimate follows from the well-known van der Cor- put’s estimate for the second

The first author’s earlier work used the Chebotarev Density Theorem, but the proof given here uses only elementary estimates... The result

If K and L are absolutely abelian number fields, however, we obtain a fairly explicit description of the number I(L/K).. This concludes the proof

Let K be an (absolutely) abelian number field of conductor n, G K its Galois group over Q, and O K the ring of integers of K.. By QG K we denote the rational and by ZG K the

Kr¨ uskemper gave a local global principle for scaled trace forms of odd dimension over an algebraic number field (see [16], Theorem 1).. We give a stronger version of