Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

QUESTION 1 Write a C++ program with the following specifications: a. Define a C++ function (name it function StudentID where StudentID is your actual student

image text in transcribed

QUESTION 1 Write a C++ program with the following specifications: a. Define a C++ function (name it function StudentID where StudentID is your actual student ID number) that has integer input (N) and double input (x) and returns a double output y, where N y = (x2 + n + x) n+ 5 n=1 N is a positive integer. b. In the main function, i. Read user input N from the command window (console), while ensuring that Nis positive (>0). If the user enters a negative number, the program should request the user to re-enter a positive (>0) number until a valid number is entered. ii. Use the above function (function StudentID) to determine the value of y for the user input N when x=2.0. Display the result using 4 decimal values. iii. Using the above function and a for loop, display the values of y for N values from 1 to 4 (1,2,3,4) when x=2.0. Display the results using 4 decimal values. Save your C++ program as quiz3_studentID.cpp where studentID is your actual 8- digit student ID. Upload your C++ file (Quiz3_StudentID.cpp) to VUWS. Verify that your submission is visible on your assignments in VUWS. QUESTION 1 Write a C++ program with the following specifications: a. Define a C++ function (name it function StudentID where StudentID is your actual student ID number) that has integer input (N) and double input (x) and returns a double output y, where N y = (x2 + n + x) n+ 5 n=1 N is a positive integer. b. In the main function, i. Read user input N from the command window (console), while ensuring that Nis positive (>0). If the user enters a negative number, the program should request the user to re-enter a positive (>0) number until a valid number is entered. ii. Use the above function (function StudentID) to determine the value of y for the user input N when x=2.0. Display the result using 4 decimal values. iii. Using the above function and a for loop, display the values of y for N values from 1 to 4 (1,2,3,4) when x=2.0. Display the results using 4 decimal values. Save your C++ program as quiz3_studentID.cpp where studentID is your actual 8- digit student ID. Upload your C++ file (Quiz3_StudentID.cpp) to VUWS. Verify that your submission is visible on your assignments in VUWS

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Michael V. Mannino

4th Edition

0615231047, 978-0615231044

More Books

Students also viewed these Databases questions