1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
konstantin123 [22]
3 years ago
14

Declare a structure with a type name: Car containing:

Computers and Technology
1 answer:
OLga [1]3 years ago
7 0

Answer:

C++ code is given below

Explanation:

#include <iostream>

#include <cctype>

#include <string.h>

#include <cstring>

#include <sstream>

using namespace std;

struct Car {

public:    

char reportingMark[5];    

int carNumber;

string kind;

bool loaded;

string destination;

};

void input(Car *);

void output(Car *);

int main() {

Car *T = new Car;    

input(T);

output(T);    

delete T;    

return 0;

}

void input(Car *T)

{

string str, s;

cout << " Enter the reporting mark as a 5 or less character uppercase string: ";

cin >> str;

for (int i = 0; i < str.length(); i++)

T->reportingMark[i] = toupper(str[i]);

cout << " Enter the car number: ";

cin >> T->carNumber;

cout << " Enter the kind: ";

cin >> T->kind;

cout << " Enter the loaded status as true or false: ";

cin >> s;    

istringstream(s) >> boolalpha >> T->loaded;    

if (T->loaded == true) {

cout << " Enter the destination: ";

cin.ignore();

getline(cin, T->destination);

}

else

T->destination = "NONE";    

}

void output(Car *T)

{

cout << " Reporting Mark: " << T->reportingMark;

cout << " Car Number: " << T->carNumber;    

cout << " Kind: " << T->kind;

cout << " Loaded Status: " << boolalpha << T->loaded;

cout << " Destination: " << T->destination << " ";

}

You might be interested in
Professor Zak allows students to drop the four lowest scores on the ten 100 point quizzes she gives during the semester. Design
lana66690 [7]

Answer:

Explanation:

Let's do this in Python, we will accept 2 arguments, the student name and an array of the 10 scores. The function would sort the scores out, get the last 6 scores, take the sum and finally out put them with the student name:

def total_six_highest_score(name, scores):

    scores.sort()

    highest_six_scores = scores[4:]

    total_highest = sum(highest_six_scores)

    return name, total_highest

4 0
3 years ago
When internet techonology was developed in the 1970s by the department of defense?
Scorpion4ik [409]
TRUE. The internet began as a military infrastructure project for communication purposes.  
3 0
2 years ago
For what type of document would you use the landscape page orientation
inysia [295]
Hi there!

Many certificates (and usually most certificates) are in the landscape page orientation.

Hope this helps!
5 0
2 years ago
When you open a browser window, it open in a _____. <br> a. fieldb. folderc. menud. window?
Romashka [77]
D. A window the rest are incorrect
4 0
3 years ago
A deleted file or folder is not permanently deleted from a computer until which event occurs?
Dimas [21]

Answer:

The computer is restarted. The Recycle Bin or Trash is emptied

Explanation:

8 0
2 years ago
Other questions:
  • A company that hires only American Indians is practicing
    5·2 answers
  • Type 1 hypervisor:
    10·1 answer
  • The relational database is the primary method for organizing and maintaining data today in information systems. It organizes dat
    9·1 answer
  • Which city is the largest within the Andean and midlatitude countries? A. Buenos Aires, Argentina B. La Paz, Bolivia C. Santiago
    11·2 answers
  • What should be done with statements or sections which are unclear?
    12·2 answers
  • Can someone solve this for me please? It’s part of an escape room.
    13·2 answers
  • What is the difference between private inheritance and composition?
    11·1 answer
  • The difference between a dot matrix printer and a line printer
    9·2 answers
  • What do you hope will be in/added GTA 6?
    13·1 answer
  • What is an infrastructure dedicated to one organization
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!