0% found this document useful (0 votes)
14 views

C++ II Assignment

The document outlines an assignment for students at Microlink Information Technology and Business College, focusing on various C++ programming tasks. Students are required to write programs for calculating volumes, temperature conversion, income evaluation, string manipulation, and file handling. The assignment is due on July 5, 2011, and must be submitted in both hardcopy and softcopy formats.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

C++ II Assignment

The document outlines an assignment for students at Microlink Information Technology and Business College, focusing on various C++ programming tasks. Students are required to write programs for calculating volumes, temperature conversion, income evaluation, string manipulation, and file handling. The assignment is due on July 5, 2011, and must be submitted in both hardcopy and softcopy formats.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Microlink information technology and Business College

Department of software Engineering


Assignment one.
 Submission date july 5, 2011;
 The assignment should be submitted in hardcopy and softcopy.
 Make sure the code runs without error

1. Write a program in C++, to calculate the volume of a sphere, cube and cylinder. Use separate
functions to calculate each volume.

2. Write a program using a function in C++ to convert temperature in Celsius to Fahrenheit and vice
versa.

3. Write a main () function and a second function that main () calls. Ask users for their annual income
in main (). Pass the income to the second function and print a congratulatory message if the user
makes more than $50,000 or an encouragement message if the user makes less.

4. Write a three-function program, consisting of the following functions: Main (), fun1 (), fun2 ()
Declare a 10-element character array in main (), fill it with the letters A through J in fun1 (), then print
that array backwards in fun2 ().

5. Write a C++ program that reads a sentence from the keyboard and prints the reversed sentence
using a recursive function.

6. Write a C++ program that takes a C-style string from the user, calculates and prints the number of
vowels, consonants, digits and white-spaces.

7. Write a C++ program that inputs a C-style string from the user and prints frequency of a given
character. 8. Write a C++ program to check whether an inserted string/ word is a Palindrome or not.

9. Write a C++ program to detect a key press on a keyboard and print the pressed key together with
its ASCII code.

10. Write a C++ program, using a structure to record appropriate information of 20 employees and
print the information on screen in a form of a list.
Assignment two

“For a long time it puzzled me how something so expensive, so leading edge, could be so useless. And
then it occurred to me that a computer is a stupid machine with the ability to do incredibly smart things,
while computer programmers are smart people with the ability to do incredibly stupid things. They are,
in short, a perfect match.”

Question: Write a C++ program that:-

 Creates a file named as ;


 Opens the created file and writes the above written paragraph on it;
 Reads and prints:

 The whole paragraph on screen ,

 Number of lines ,

 Number of words and

 Number of characters in the paragraph.

NB: Try to perform all activities using the concept of File Handling.

You might also like