Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ coding assignment: Define a struct in your header along with the following global constant as: const int MAX -255; struct Computerc char model[MAX]; unsigned
C++ coding assignment:
Define a struct in your header along with the following global constant as: const int MAX -255; struct Computerc char model[MAX]; unsigned long int clockRate; unsigned long int memory; unsigned long int storage; J; char make [MAX]; Write a function that takes three parameters: an array of struct of type Computer; the size of the array; an ostream& to write output from this function (see below). Assume make and model are well-formed c-strings. Print a header in this form to the ostream& parameter: Make Model Clock Rate (GHz Memory*(GB) Storage (GB) Use setw(18) for each header item. End the header with a newline. Iterate through the array and print all values in each struct to the ostream& parameter following these rules. Make sure the columns line up with the table header (right-justified) a) make, print directly. b) model, print directly. c) clockRate is passed as an unsigned int representing the clock rate of the processor in Hz (Hertz). Convert to GHz (gigaHertz) and print. memory. Convert to GB secondary storage. Convert to GB (gigabytes) and print, followed by a new-line. d) memory is passed as an unsigned int representing the number of bytes of (gigabytes) and print. e) storage is passed as an unsigned int representing the number of bytes of Function prototype: void PrintComputers(const Computer computersI], size t, ostream&)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started