Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iomanip>
- #include <cmath>
- #include <iostream>
- using namespace std;
- struct Laptop
- {
- char Model[11];
- char Marka[11];
- char Color[9];
- char age[5];
- char SerialNumber[5];
- double Inches;
- double Price;
- };
- double Reshenie(double Price) {
- double EndPrice = 0;
- if ((Price <= 500) && (Price >= 700)) {
- EndPrice = 0.02;
- }
- else {
- cout << "Cenata Zapochva ot 500lv.";
- }
- if (Price >= 701 && Price <= 900) {
- EndPrice = 0.035;
- }
- else if (Price >= 901 && Price <= 1000) {
- EndPrice = 0.05;
- }
- else if (Price >= 1001) {
- EndPrice = 0.062;
- }
- return EndPrice;
- }
- int main() {
- Laptop M1, M2, M3, M4, M5;
- cout << "Laptop 1 model: ";
- cin.getline(M1.Model, 11);
- cout << "Laptop 1 brand: ";
- cin.getline(M1.Marka, 11);
- cout << "Laptop 1 color: ";
- cin.getline(M1.Color, 9);
- cout << "Laptop 1 year of made: ";
- cin.getline(M1.age, 5);
- cout << "Laptop 1 last four numbers of serial number: ";
- cin.getline(M1.SerialNumber, 5);
- cout << "Laptop 1 Inches: ";
- cin >> M1.Inches;
- cout << "Laptop 1 price: ";
- cin >> M1.Price;
- cin.ignore();
- cout << "" << endl;
- cout << "Laptop 2 model: ";
- cin.getline(M2.Model, 11);
- cout << "Laptop 2 brand: ";
- cin.getline(M2.Marka, 11);
- cout << "Laptop 2 color: ";
- cin.getline(M2.Color, 9);
- cout << "Laptop 2 year of made: ";
- cin.getline(M2.age, 5);
- cout << "Laptop 2 last four numbers of serial number: ";
- cin.getline(M2.SerialNumber, 5);
- cout << "Laptop 2 Inches: ";
- cin >> M2.Inches;
- cout << "Laptop 2 price[lv.]: ";
- cin >> M2.Price;
- cin.ignore();
- cout << "" << endl;
- cout << "Laptop 3 model: ";
- cin.getline(M3.Model, 11);
- cout << "Laptop 3 brand: ";
- cin.getline(M3.Marka, 11);
- cout << "Laptop 3 color: ";
- cin.getline(M3.Color, 9);
- cout << "Laptop 3 year of made: ";
- cin.getline(M3.age, 5);
- cout << "Laptop 3 last four numbers of serial number: ";
- cin.getline(M3.SerialNumber, 5);
- cout << "Laptop 3 Inches: ";
- cin >> M3.Inches;
- cout << "Laptop 3 price[lv.]: ";
- cin >> M3.Price;
- cin.ignore();
- cout << "" << endl;
- cout << "Laptop 4 model: ";
- cin.getline(M4.Model, 11);
- cout << "Laptop 4 brand: ";
- cin.getline(M4.Marka, 11);
- cout << "Laptop 4 color: ";
- cin.getline(M4.Color, 9);
- cout << "Laptop 4 year of made: ";
- cin.getline(M4.age, 5);
- cout << "Laptop 4 last four numbers of serial number: ";
- cin.getline(M4.SerialNumber, 5);
- cout << "Laptop 4 Inches: ";
- cin >> M4.Inches;
- cout << "Laptop 4 price[lv.]: ";
- cin >> M4.Price;
- cin.ignore();
- cout << "" << endl;
- cout << "Laptop 5 model: ";
- cin.getline(M5.Model, 11);
- cout << "Laptop 5 brand: ";
- cin.getline(M5.Marka, 11);
- cout << "Laptop 5 color: ";
- cin.getline(M5.Color, 9);
- cout << "Laptop 5 year of made: ";
- cin.getline(M5.age, 5);
- cout << "Laptop 5 last four numbers of serial number: ";
- cin.getline(M5.SerialNumber, 5);
- cout << "Laptop 5 Inches: ";
- cin >> M5.Inches;
- cout << "Laptop 5 price[lv.]: ";
- cin >> M5.Price;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement