Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question - 1 Your task is to write a C + + program that demonstrates the use of function templates. The program should find the
Question Your task is to write a C program that demonstrates the use of function templates. The program should find the maximum value among three input values of different types int double, and char using a function template. Instructions: Create a new C source file maincpp for your program Create a header file named maximum.h where you will define the function template maximum In the main.cpp file: Include the maximum.h header file using the #include directive. Implement the main function, which will be the entry point of your program. Inside the main function: Prompt the user to input three integer values and find the maximum among them using the maximum function template. Prompt the user to input three double values and find the maximum among them using the maximum function template. Prompt the user to input three character values and find the maximum among them using the maximum function template.Display the maximum values found for each type. Example Output:Input three integer values: The maximum integer value is: Input three double values: The maximum double value is: Input three characters: A C BThe maximum character value is: C Submission:Submit your completed main.cpp file, which includes the implementation of the main function and the #include directive for the maximum.h header file. Also, submit your maximum.h header file, where you define the function template maximum. Question In this question you will practice creating a simple class called GradeBook and using it in a C program. Follow the instructions below to complete the assignment: Define the GradeBook Class: Define a class named GradeBook with a member function named displayMessage. The displayMessage function should take a single parameter of type string, representing the course name. Inside the displayMessage function, output a welcome message that includes the provided course name Create an Object and Display the Message: In the main function, declare a variable named nameOfCourse of type string. Create an object of the GradeBook class named myGradeBook. Prompt the user to enter the name of the course. Read the course name entered by the user into the nameOfCourse variable using the getline function. Call the displayMessage function of the myGradeBook object and pass the nameOfCourse variable as an argument. Ensure that the welcome message is displayed correctly with the provided course name Submit Your Code: Write a C program that implements the above steps. Save the program file with an appropriate name eg gradebook.cpp Ensure your code is properly formatted and documented with comments. Submit your code file through the designated submission platform by the due date.Note: Remember to adhere to best practices for coding, such as using meaningful variable names, proper indentation, and clear comments to explain your code.
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