SlideShare a Scribd company logo
Learning the java language
Workshop 1:
 How to use primitive Java types, operators on those types, and expressions formed with
those types
 How to use loop and other flow control structures
 How to use array
Q1. Write a program that performs the following tasks:
1. Input 4 real numbers a, b, c and x.
2. Calculate S1 = ax2
+ bx + c.
3. Calculate S2 = acb 42
 if b - 4ac > 0, otherwise S2 = 0
4. Re-input a, b and c. Check whether a, b and c are sides of a triangle or not.
5. If a, b, c are sides of a triangle, then calculate its perimeter and area, otherwise display on
the screen a message "a, b, c are not side of a triangle". The area is calculated by the
Heron formula below:
S1 = ))()(( cpbpapp  , where
2
)( cba
p


Q2. Write a program that performs the following tasks:
1. Input an integer number n, where n > 5 (If n≤ 5 then
prompt a user to re-enter). Then calculate
2. S1 = 1 + 2 + 3 + ... + n.
3. S2 = n!
4. S3 =1+
2
1
+
3
1
+...+
n
1
.
5. Re-input n. Check whether n is a prime number or not.
Q3. Write a program to accept 2 integer numbers m and n, then:
1. Display all prime common dividers of them.
2. Find the greatest common divider (GCD) of them.
3. Find the least common multiple (LCM) of them.
Q4. Write a program that performs the following tasks:
1. Input an integer number n (check input validation), then
2. Display n in binary number format.
3. Re-input n (not check input validation). Calculate sum of all digits of n.
4. Find the number m, which is the reverse of n.
Q5. Write a program to accept 3 real numbers a, b and c, then
Solve the quadratic equation ax2
+ bx + c = 0.
Q6. Write a program to accept 2 integer numbers m and n, where m < n then
Display all palindrom numbers in the interval [m.n]. (A palindromic number or numeral
palindrome is a number that remains the same when its digits are reversed, e.g. 16461)
Q7. Write a program that performs the following tasks:
1. Write function with prototype
double myExp(double x, int n);
which calculate ex
approximately by the formula:
ex
~ S = 1+
!1
x
+
!2
2
x
+ ... +
!n
xn
2. Write function with prototype
double myExp(double x, double epsi);
which calculate and return ex
approximately by the formula:
ex
~ S = 1+
!1
x
+
!2
2
x
+ ... +
!n
xn
here n is the first integer for which |
!n
xn
|  epsi is satisfied.
3 . Write function with prototype:
double myPi(double epsi);
which calculates and return the value PI approximately by the formula:
 ~ S = 4* (1-
3
1
+
5
1
-
7
1
+...+(-1)n
12
1
n
)
here n is the first integer for which |
12
1
n
|  epsi is satisfied.
4. Write function with prototype:
double mySin(double x, double epsi);
which calculates and return the value sin(x) approximately by the formula:
sin(x) =
!1
x
-
!3
3
x
+
!5
5
x
-... +(-1)n
)!12(
)12(


n
x n
here n is the first integer for which |
12
1
n
|  epsi is satisfied.
5. Write function with prototype:
double myCos(double x, double epsi);
which calculates and return the value cos(x) approximately by the formula:
cos(x) = 1 -
!2
2
x
+
!4
4
x
-... +(-1)n
)!2(
2
n
x n
here n is the first integer for which |
)!2(
2
n
x n
|  epsi is satisfied.
6. Write a Java program that performs the following operations on an array of integers in the
main function:
- Input data (number of elements, the elements of the arrays)
- Display all elements
- Sort all numbers in ascending order
- Find the maximum value
Q8. Write a menu driven program with the options below:
Choose one of the following option:
1. Input 2 polynomials Pn
(x) and Qm
(x)
2. Calculate Pn
(x0) và Qm
(x0)
3. The derivatives of polynomials
4. Calculate Pn
(x) + Qm
(x)
5. Calculate Pn
(x) - Qm
(x)
6. Calculate Pn
(x) x Qm
(x)
7. Calculate Pn
(x) / Qm
(x)
Q9. Financial Calculator
Design and code a program that performs two financial calculations: future value and present
value. Your program prompts for and accepts a principal amount, an interest rate per year, and
the number of years. If the number of periods is zero then the calculated amount is a present
value (principal).
Suppose Pn is an amount after n years, thus we have
Pn = Pn-1 + rate*Pn-1 = (1 + rate)*Pn-1
It easy to show that
Pn = (1 + rate)n
P0
where P0 is a principal.
Design your program according to structured design principles and include a function that can be
used in both calculations as well as in other applications.
Preface your function header with a comprehensive description of the function purpose, the
function parameters and the function return value.
The output from your program should look something like:
Q10. Write a menu driven program with the options below:
Choose one of the following option:
1. Input a string
2. Split a string into words
3. Remove redundant soaces
4. Check valid name
5. Exit
Your selection (0->5):
Q11. The correct sentence: Capitalize the First Word in a Sentence, one space between words,
a space following commas and periods.

More Related Content

What's hot

A1 11 functions
A1 11 functionsA1 11 functions
A1 11 functions
vhiggins1
 
Derivative3
Derivative3Derivative3
Derivative3
vpaci
 

What's hot (20)

Number system.pdf
Number system.pdfNumber system.pdf
Number system.pdf
 
Loop Statements [5] M
Loop Statements [5] MLoop Statements [5] M
Loop Statements [5] M
 
Sorting and Searching - Data Structure - Notes
Sorting and Searching - Data Structure - NotesSorting and Searching - Data Structure - Notes
Sorting and Searching - Data Structure - Notes
 
Queue - Data Structure - Notes
Queue - Data Structure - NotesQueue - Data Structure - Notes
Queue - Data Structure - Notes
 
A1 11 functions
A1 11 functionsA1 11 functions
A1 11 functions
 
Booth Multiplier
Booth MultiplierBooth Multiplier
Booth Multiplier
 
Number System
Number SystemNumber System
Number System
 
Stack - Data Structure - Notes
Stack - Data Structure - NotesStack - Data Structure - Notes
Stack - Data Structure - Notes
 
Calculus- Basics
Calculus- BasicsCalculus- Basics
Calculus- Basics
 
What is Function?
What is Function?What is Function?
What is Function?
 
Derivative3
Derivative3Derivative3
Derivative3
 
Java Tutorial: Part 4 - Data and Calculations
Java Tutorial: Part 4 - Data and CalculationsJava Tutorial: Part 4 - Data and Calculations
Java Tutorial: Part 4 - Data and Calculations
 
C programming slide c05
C programming slide c05C programming slide c05
C programming slide c05
 
number system
number systemnumber system
number system
 
Writea program that defines a template function named add(). Thisfunction tak...
Writea program that defines a template function named add(). Thisfunction tak...Writea program that defines a template function named add(). Thisfunction tak...
Writea program that defines a template function named add(). Thisfunction tak...
 
November 2, 2015
November 2, 2015November 2, 2015
November 2, 2015
 
Number System and Boolean Algebra
Number System and Boolean AlgebraNumber System and Boolean Algebra
Number System and Boolean Algebra
 
Number System in CoMpUtEr
Number System in CoMpUtErNumber System in CoMpUtEr
Number System in CoMpUtEr
 
Dynamic allocation
Dynamic allocationDynamic allocation
Dynamic allocation
 
Number system with conversions www.eakanchha.com
Number system with conversions www.eakanchha.comNumber system with conversions www.eakanchha.com
Number system with conversions www.eakanchha.com
 

Similar to Exercise1 java

M166Calculus” ProjectDue Wednesday, December 9, 2015PROJ.docx
M166Calculus” ProjectDue Wednesday, December 9, 2015PROJ.docxM166Calculus” ProjectDue Wednesday, December 9, 2015PROJ.docx
M166Calculus” ProjectDue Wednesday, December 9, 2015PROJ.docx
infantsuk
 
CD504 CGM_Lab Manual_004e08d3838702ed11fc6d03cc82f7be.pdf
CD504 CGM_Lab Manual_004e08d3838702ed11fc6d03cc82f7be.pdfCD504 CGM_Lab Manual_004e08d3838702ed11fc6d03cc82f7be.pdf
CD504 CGM_Lab Manual_004e08d3838702ed11fc6d03cc82f7be.pdf
RajJain516913
 

Similar to Exercise1 java (20)

M166Calculus” ProjectDue Wednesday, December 9, 2015PROJ.docx
M166Calculus” ProjectDue Wednesday, December 9, 2015PROJ.docxM166Calculus” ProjectDue Wednesday, December 9, 2015PROJ.docx
M166Calculus” ProjectDue Wednesday, December 9, 2015PROJ.docx
 
A01
A01A01
A01
 
Lecture 7.pptx
Lecture 7.pptxLecture 7.pptx
Lecture 7.pptx
 
Programming qns
Programming qnsProgramming qns
Programming qns
 
Cse cpl manual-2016
Cse cpl manual-2016Cse cpl manual-2016
Cse cpl manual-2016
 
GE3171-PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORY
GE3171-PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORYGE3171-PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORY
GE3171-PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORY
 
A New Deterministic RSA-Factoring Algorithm
A New Deterministic RSA-Factoring AlgorithmA New Deterministic RSA-Factoring Algorithm
A New Deterministic RSA-Factoring Algorithm
 
Functions Practice Sheet.docx
Functions Practice Sheet.docxFunctions Practice Sheet.docx
Functions Practice Sheet.docx
 
A02
A02A02
A02
 
CD504 CGM_Lab Manual_004e08d3838702ed11fc6d03cc82f7be.pdf
CD504 CGM_Lab Manual_004e08d3838702ed11fc6d03cc82f7be.pdfCD504 CGM_Lab Manual_004e08d3838702ed11fc6d03cc82f7be.pdf
CD504 CGM_Lab Manual_004e08d3838702ed11fc6d03cc82f7be.pdf
 
Java programming lab assignments
Java programming lab assignments Java programming lab assignments
Java programming lab assignments
 
Computer graphics lab manual
Computer graphics lab manualComputer graphics lab manual
Computer graphics lab manual
 
Java conceptual learning material
Java conceptual learning materialJava conceptual learning material
Java conceptual learning material
 
Programming Fundamental handouts
Programming Fundamental handoutsProgramming Fundamental handouts
Programming Fundamental handouts
 
COMPUTER SCIENCE INVESTIGATORY PROJECT 2017-18
COMPUTER SCIENCE INVESTIGATORY PROJECT 2017-18COMPUTER SCIENCE INVESTIGATORY PROJECT 2017-18
COMPUTER SCIENCE INVESTIGATORY PROJECT 2017-18
 
C important questions
C important questionsC important questions
C important questions
 
Solution of matlab chapter 4
Solution of matlab chapter 4Solution of matlab chapter 4
Solution of matlab chapter 4
 
Loops in Python
Loops in PythonLoops in Python
Loops in Python
 
Class 8b: Numpy & Matplotlib
Class 8b: Numpy & MatplotlibClass 8b: Numpy & Matplotlib
Class 8b: Numpy & Matplotlib
 
C code examples
C code examplesC code examples
C code examples
 

More from NguynMinh294

More from NguynMinh294 (20)

Slide An toàn mạng nâng cao PTIT
Slide An toàn mạng nâng cao PTITSlide An toàn mạng nâng cao PTIT
Slide An toàn mạng nâng cao PTIT
 
Phân tích thiết kế hệ thống thông tin PTIT
Phân tích thiết kế hệ thống thông tin PTIT Phân tích thiết kế hệ thống thông tin PTIT
Phân tích thiết kế hệ thống thông tin PTIT
 
Bài giảng mật mã học cơ sở PTIT
Bài giảng mật mã học cơ sở PTITBài giảng mật mã học cơ sở PTIT
Bài giảng mật mã học cơ sở PTIT
 
Bài giảng an toàn ứng dụng web và csdl PTIT
Bài giảng an toàn ứng dụng web và csdl PTITBài giảng an toàn ứng dụng web và csdl PTIT
Bài giảng an toàn ứng dụng web và csdl PTIT
 
Bài giảng an toàn ứng dụng web và csdl PTIT
Bài giảng an toàn ứng dụng web và csdl PTITBài giảng an toàn ứng dụng web và csdl PTIT
Bài giảng an toàn ứng dụng web và csdl PTIT
 
Bài giảng kiểm thử xâm nhập PTIT
Bài giảng kiểm thử xâm nhập PTITBài giảng kiểm thử xâm nhập PTIT
Bài giảng kiểm thử xâm nhập PTIT
 
Bài giảng ký thuật theo dõi giám sát mạng PTIT
Bài giảng ký thuật theo dõi giám sát mạng PTITBài giảng ký thuật theo dõi giám sát mạng PTIT
Bài giảng ký thuật theo dõi giám sát mạng PTIT
 
Giáo trình mạng máy tính PTIT
Giáo trình mạng máy tính PTITGiáo trình mạng máy tính PTIT
Giáo trình mạng máy tính PTIT
 
Ktvxl chuong 5 - cac phuong phap vao ra du lieu
Ktvxl chuong 5 - cac phuong phap vao ra du lieuKtvxl chuong 5 - cac phuong phap vao ra du lieu
Ktvxl chuong 5 - cac phuong phap vao ra du lieu
 
Ktvxl chuong 4 - phoi ghep
Ktvxl chuong 4 - phoi ghepKtvxl chuong 4 - phoi ghep
Ktvxl chuong 4 - phoi ghep
 
Ktvxl chuong 3 - hop ngu 8088
Ktvxl chuong 3 - hop ngu 8088Ktvxl chuong 3 - hop ngu 8088
Ktvxl chuong 3 - hop ngu 8088
 
Ktvxl chuong 2 - 8086-8088
Ktvxl chuong 2 - 8086-8088Ktvxl chuong 2 - 8086-8088
Ktvxl chuong 2 - 8086-8088
 
Ktvxl chuong 1 - tong quan
Ktvxl chuong 1 - tong quanKtvxl chuong 1 - tong quan
Ktvxl chuong 1 - tong quan
 
bài giảng ký thuật vi xử lý PTIT
bài giảng ký thuật vi xử lý PTITbài giảng ký thuật vi xử lý PTIT
bài giảng ký thuật vi xử lý PTIT
 
đề thi java ptit
đề thi java ptitđề thi java ptit
đề thi java ptit
 
Java exercises part 2
Java exercises part 2Java exercises part 2
Java exercises part 2
 
Java exercises part 1
Java exercises part 1Java exercises part 1
Java exercises part 1
 
Bai tap3 java
Bai tap3 javaBai tap3 java
Bai tap3 java
 
Bai tap2 java
Bai tap2 javaBai tap2 java
Bai tap2 java
 
Giáo trình hệ điều hành PTIT
Giáo trình hệ điều hành PTITGiáo trình hệ điều hành PTIT
Giáo trình hệ điều hành PTIT
 

Recently uploaded

Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 

Recently uploaded (20)

How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
 
B.ed spl. HI pdusu exam paper-2023-24.pdf
B.ed spl. HI pdusu exam paper-2023-24.pdfB.ed spl. HI pdusu exam paper-2023-24.pdf
B.ed spl. HI pdusu exam paper-2023-24.pdf
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...
UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...
UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 

Exercise1 java

  • 1. Learning the java language Workshop 1:  How to use primitive Java types, operators on those types, and expressions formed with those types  How to use loop and other flow control structures  How to use array Q1. Write a program that performs the following tasks: 1. Input 4 real numbers a, b, c and x. 2. Calculate S1 = ax2 + bx + c. 3. Calculate S2 = acb 42  if b - 4ac > 0, otherwise S2 = 0 4. Re-input a, b and c. Check whether a, b and c are sides of a triangle or not. 5. If a, b, c are sides of a triangle, then calculate its perimeter and area, otherwise display on the screen a message "a, b, c are not side of a triangle". The area is calculated by the Heron formula below: S1 = ))()(( cpbpapp  , where 2 )( cba p   Q2. Write a program that performs the following tasks: 1. Input an integer number n, where n > 5 (If n≤ 5 then prompt a user to re-enter). Then calculate 2. S1 = 1 + 2 + 3 + ... + n. 3. S2 = n! 4. S3 =1+ 2 1 + 3 1 +...+ n 1 . 5. Re-input n. Check whether n is a prime number or not. Q3. Write a program to accept 2 integer numbers m and n, then: 1. Display all prime common dividers of them. 2. Find the greatest common divider (GCD) of them. 3. Find the least common multiple (LCM) of them. Q4. Write a program that performs the following tasks: 1. Input an integer number n (check input validation), then 2. Display n in binary number format. 3. Re-input n (not check input validation). Calculate sum of all digits of n. 4. Find the number m, which is the reverse of n. Q5. Write a program to accept 3 real numbers a, b and c, then Solve the quadratic equation ax2 + bx + c = 0. Q6. Write a program to accept 2 integer numbers m and n, where m < n then Display all palindrom numbers in the interval [m.n]. (A palindromic number or numeral palindrome is a number that remains the same when its digits are reversed, e.g. 16461)
  • 2. Q7. Write a program that performs the following tasks: 1. Write function with prototype double myExp(double x, int n); which calculate ex approximately by the formula: ex ~ S = 1+ !1 x + !2 2 x + ... + !n xn 2. Write function with prototype double myExp(double x, double epsi); which calculate and return ex approximately by the formula: ex ~ S = 1+ !1 x + !2 2 x + ... + !n xn here n is the first integer for which | !n xn |  epsi is satisfied. 3 . Write function with prototype: double myPi(double epsi); which calculates and return the value PI approximately by the formula:  ~ S = 4* (1- 3 1 + 5 1 - 7 1 +...+(-1)n 12 1 n ) here n is the first integer for which | 12 1 n |  epsi is satisfied. 4. Write function with prototype: double mySin(double x, double epsi); which calculates and return the value sin(x) approximately by the formula: sin(x) = !1 x - !3 3 x + !5 5 x -... +(-1)n )!12( )12(   n x n here n is the first integer for which | 12 1 n |  epsi is satisfied. 5. Write function with prototype: double myCos(double x, double epsi); which calculates and return the value cos(x) approximately by the formula: cos(x) = 1 - !2 2 x + !4 4 x -... +(-1)n )!2( 2 n x n here n is the first integer for which | )!2( 2 n x n |  epsi is satisfied. 6. Write a Java program that performs the following operations on an array of integers in the main function: - Input data (number of elements, the elements of the arrays)
  • 3. - Display all elements - Sort all numbers in ascending order - Find the maximum value Q8. Write a menu driven program with the options below: Choose one of the following option: 1. Input 2 polynomials Pn (x) and Qm (x) 2. Calculate Pn (x0) và Qm (x0) 3. The derivatives of polynomials 4. Calculate Pn (x) + Qm (x) 5. Calculate Pn (x) - Qm (x) 6. Calculate Pn (x) x Qm (x) 7. Calculate Pn (x) / Qm (x) Q9. Financial Calculator Design and code a program that performs two financial calculations: future value and present value. Your program prompts for and accepts a principal amount, an interest rate per year, and the number of years. If the number of periods is zero then the calculated amount is a present value (principal). Suppose Pn is an amount after n years, thus we have Pn = Pn-1 + rate*Pn-1 = (1 + rate)*Pn-1 It easy to show that Pn = (1 + rate)n P0 where P0 is a principal. Design your program according to structured design principles and include a function that can be used in both calculations as well as in other applications. Preface your function header with a comprehensive description of the function purpose, the function parameters and the function return value. The output from your program should look something like:
  • 4. Q10. Write a menu driven program with the options below: Choose one of the following option: 1. Input a string 2. Split a string into words 3. Remove redundant soaces 4. Check valid name 5. Exit Your selection (0->5): Q11. The correct sentence: Capitalize the First Word in a Sentence, one space between words, a space following commas and periods.