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++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter4: Selection Structures
Section4.3: Nested If Statements
Problem 7E
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++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
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