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
Meg wants to preview all images in a folder so that she can quickly find the image she wants. Which view will help her do this?
Liono4ka [1.6K]
Thumbnails is the answer

3 0
3 years ago
Statement: There are two files. One file, "badIP_list.txt" has a listing of known bad IP addresses. These addresses were extract
lapo4ka [179]

Answer:

See explaination

Explanation:

SOURCE CODE IN PYTHON:

inp=open('badIP_list.txt', 'r') #opening file for input

badIPs=[i.rstrip('\n') for i in inp.readlines()] #reading bad IPs

inp.close() #closing file

inp=open('server_logs.txt', 'r') #opening file for input

IPs=[i.rstrip('\n') for i in inp.readlines()] #reading all IPs from log

inp.close() #closing file

uniqueBadIPs=[] #to store unique bad IPs

countBadIPs=0 #to store count of bad IPs

countIPs=0 #to store count of all IPs

for IP in IPs: #iterating through the log of IPs

if IP in badIPs: #checking if IP is bad

countBadIPs+=1

if IP not in uniqueBadIPs: #checking if bad IP is unique

uniqueBadIPs.append(IP)

countIPs+=1

out=open('filter_list.txt', 'w') #opening file for output

out.write('_________________________________________________________\n')

out.write('Date : 26/07/2018\nName : Last, First\nMajor: CS\n\n')

out.write('Server logs contained these known bad IP addresses:\n')

for IP in uniqueBadIPs: #output the unique bad IPs

out.write(IP+'\n')

out.write('\n')

out.write('Total unique known bad IP\'s detected:\n'+str(len(uniqueBadIPs))+'\n\n')

out.write('Percentage of bad IP addresses in server logs:\n{:.2f}%\n'.format(countBadIPs*100/countIPs))

out.write('_________________________________________________________')

out.close() #closing file

5 0
3 years ago
Bill is building a project network that involves testing a prototype. he must design the prototype (activity 1), build the proto
Vedmedyk [2.9K]

Answer:

Bill is building a project network that involves testing a prototype. he must design the prototype (activity 1), build the prototype (activity 2), and test the prototype (activity 3). activity 1 is the predecessor for activity 2 and activity 2 is the predecessor for activity 3. if the prototype fails testing, bill must redesign the prototype; therefore, activity 3 is a predecessor for activity 1. this is an example of

b. looping

Explanation:

  • The given example is of looping because each activity is leading to another activity on the completion of some conditions.
  • The answer a is not valid as it is not just an example of conditional statements rather it is a loop which will keep moving until unless reached a situation to end it.
  • The option c, d an e are not right options for the given example.
4 0
3 years ago
A ____ is several programs simultaneously processing the same I/O stream.
Sonja [21]
Concurrent multiple program execution, opposite to pipeline execution where it needs to in a sequential or in order of execution. You can also say parallel process programming.
6 0
3 years ago
Read 2 more answers
Assume a branch instruction bne $t1, $t2, Label is located in 0x00001840 in the instruction memory. The 16-bits branch address i
Ilia_Sergeevich [38]

Answer:

a. 0x00001844

Explanation:

When the branch is takes the new program counter value is increased by 1. The value of existing memory is labelled with number sets and then next instruction is accepted in sequence. The new value is the increase in the current labelled value.

8 0
2 years ago
Other questions:
  • What is the only language a microprocessor can process directly but most programmers almost never write programs in this code?
    5·1 answer
  • The two types of objects responsible for collecting data are
    14·1 answer
  • Given input characters for an arrowhead and arrow body, print a right-facing arrow. Ex: If the input is: *
    14·1 answer
  • What was the first Apple computer, and who was it designed by?
    7·2 answers
  • The following SQL statement contains which type of subquery? SELECT title FROM books WHERE EXISTS (SELECT isbn FROM orderitems W
    14·1 answer
  • What is the disadvantages of using proprietary software
    10·2 answers
  • Testing for information would be most likely to occur in which type of engineering?
    5·2 answers
  • The model for Diminishing Marginal Utility is ______ in nature.
    12·1 answer
  • Write a program in c++ that plays a number guessing game with a Human user. The Human user will think of a number between 1 and
    7·2 answers
  • Can anybody answer this
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!