Q2: Answer two of the following: 1- Write a C++ function that returns the sign of the number. The function should work with integer and float numbers. C++ (-1 ifx<0, sign(x) ={ 0 if x = 0, 1 if x>0. 2- Write a C++ program to ask the user to enter his her first and second name. After that, ask them to enter their third name and then save the first, second and third names in a new string.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter6: User-defined Functions
Section: Chapter Questions
Problem 1TF: Mark the following statements as true or false: a. To use a predefined function in a program, you...
icon
Related questions
Question
i need the answer quickly
Q2: Answer two of the following:
1- Write a C++ function that returns the sign of the number. The function should work with
integer and float numbers.
(-1 ifx<0,
sign(x) ={ 0 if x = 0,
1 if x>0.
C++
2- Write a C++ program to ask the user to enter his/her first and second name. After that, ask
them to enter their third name and then save the first, second and third names in a new string.
3- Write a C++ program to enter records of students using the class method. The class should
contain Student ID, Age and Date of birth members. All members are needed to be private.
Transcribed Image Text:Q2: Answer two of the following: 1- Write a C++ function that returns the sign of the number. The function should work with integer and float numbers. (-1 ifx<0, sign(x) ={ 0 if x = 0, 1 if x>0. C++ 2- Write a C++ program to ask the user to enter his/her first and second name. After that, ask them to enter their third name and then save the first, second and third names in a new string. 3- Write a C++ program to enter records of students using the class method. The class should contain Student ID, Age and Date of birth members. All members are needed to be private.
Expert Solution
steps

Step by step

Solved in 3 steps with 4 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning