Declare a structure whose tag name is Server and that contains the following fields: manufacturer, a string, model and serialnum, both also strings, year, an int, clockSpeed, a double, cores, an int, ram, an int and finally storage an int.

C++

LANGUAGE: C++ CHALLENGE: Declare a structure whose tag name is Server and that contains the following fields: manufacturer, a string, model and serialnum, both also strings, year, an int, clockSpeed, a double, cores, an int, ram, an int and finally storage an int.

Read More

Assume the availability of a function named oneMore. This function receives an integer and returns one more than its parameter. So, pass oneMore(12 ) and it will return 13.

C++

LANGUAGE: C++ CHALLENGE: Assume the availability of a function named oneMore. This function receives an integer and returns one more than its parameter. So, pass oneMore(12 ) and it will return 13. DO NOT DEFINE this function– just assume it is available. YOUR TASK: write an expression whose value is 5 but in your expression you can…

Read More

Assume that two parallel arrays have been declared and initialized: healthOption an array of type char that contains letter codes for different healthcare options and annualCost an array of type int.

C++

LANGUAGE: C++ CHALLENGE: Assume that two parallel arrays have been declared and initialized: healthOption an array of type char that contains letter codes for different healthcare options and annualCost an array of type int. The i-th element of annualCost indicates the annual cost of the i-th element of healthOption. In addition, there is an char…

Read More

Project 18: Broken Keypad. The keypad on your oven is used to enter the desired baking temperature and is arranged like the digits on a phone

C++

LANGUAGE: Java CHALLENGE: Project 18: Broken Keypad. The keypad on your oven is used to enter the desired baking temperature and is arranged like the digits on a phone: 123 456 789 0 Unfortunately the circuitry is damaged and the digits in the leftmost column no longer function. In other words, the digits 1, 4,…

Read More

Consider this data sequence: “3 11 5 5 5 2 4 6 6 7 3 -8”. Any value that is the same as the immediately preceding value is considered a CONSECUTIVE DUPLICATE.

C++

LANGUAGE: Java CHALLENGE: Consider this data sequence: “3 11 5 5 5 2 4 6 6 7 3 -8”. Any value that is the same as the immediately preceding value is considered a CONSECUTIVE DUPLICATE. In this example, there are three such consecutive duplicates: the 2nd and 3rd 5s and the second 6. Note that…

Read More

Declare an fstream object named a_log. Using a_log, check if the file activityLog exists. If the file activityLog does not already exist, open it for writing using a_log; otherwise open the file activityLog2 for writing using a_log.

C++

LANGUAGE: C++ CHALLENGE: Declare an fstream object named a_log. Using a_log, check if the file activityLog exists. If the file activityLog does not already exist, open it for writing using a_log; otherwise open the file activityLog2 for writing using a_log.

Read More

Write the definition of a function square, which receives an integer parameter and returns the square of the value of the parameter.

C++

LANGUAGE: C++ CHALLENGE: Write the definition of a function square, which receives an integer parameter and returns the square of the value of the parameter. So if the parameter ‘s value is 7, the function returns the value 49. If the parameter ‘s value happens to be 25, the functions returns the value 625. If…

Read More