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 << " ";
}
Answer:
A subroutine is a block of statements that carries out one or more tasks. ... they share all variables with the rest of the main program. ... Once you have defined a function in your program, you may use it in any appropriate expression, such as: ... Thus, functions can- not change the values of the arguments passed to them.
Explanation:
Answer:
Documents: For composing letters, flyers, essays, and other text-based files (similar to Microsoft Word documents)
google sheets logo Spreadsheets: For storing and organizing information (similar to Microsoft Excel workbooks)
google slides logo Presentations: For creating slideshows (similar to Microsoft PowerPoint presentations)
google forms logo Forms: For collecting and organizing data
google drawings logo Drawings: For creating simple vector graphics or diagrams
Explanation:
Answer:
Explanation:
The following is written in C and creates a structure declaration named savingsAccount and adds all of the values into it as defined in the question.
struct savingsAccount {
char AccountNumber[] = "";
double AccountBalance;
double InterestRate;
double AverageMonthlyBalance;
}
import turtle
window = turtle.Screen()
tr = turtle.Turtle()
tr.forward(100)
tr.left(90)
tr.forward(100)
tr.left(90)
tr.forward(100)
tr.left(90)
tr.forward(100)
tr.back(100)
tr.left(120)
tr.forward(75)
tr.right(78)
tr.forward(60)
window.mainloop()
In my code, we use the turtle module for the graphics to draw the house with a roof.