Write a program using string functions that will accept the name of the country as input value and will display the corresponding capital. Here is the list of the countries and their capitals.
COUNTRY CAPITAL
Canada Ottawa
United States Washington D.C.
U.S.S.R. Moscow
Italy Rome
Philippines Manila
Create a class Employee with following data members, name, id, and salary as private data member. Create array of objects for four employees, compare their salary using operator overloading, and display the records of the student who is getting less salary.
Write a C++ program to create a new file named “college.txt” to store list of colleges under Punjab university. Read names of 3 colleges (consider input given below) from console and store it in “college.txt”. Further copy contents of “college.txt” in another file “university.txt”. Now open the “university.txt” file and display the following (underlined) characters on console using file manipulation functions. Input: Lovely Professional University Thapar Institute of Engineering and Technology Dr B R Ambedkar National Institute of Technolog
Raman has some data in his laptop saved in two different files, but now he wants to combine the data in one file from these two files. Write a program to complete this task.
Define a class Employee with data member as name,emp_id,age. Wrie a programm to write the data of three employee's using class object. Read the records of employee and print them to console
Write an efficient C++ program to make a matrices calculator. Your program must be having the
following options.
1) Addition of two matrices
2) Subtraction of two matrices
3) Finding the transpose of a matrix
Elements and size of the matrix will be inputted by the user and there is no limit on the size of matrix.
Use the characters A, S and T for addition, subtraction and transpose respectively. Try to complete
your program in minimum possible lines.
Hints
• Use dynamic memory allocation and passing arrays as argument to functions will reduce the
lines of code significantly.
• Write a function for taking the input in a matrix.
• Write another function for displaying the elements of a matrix.
• If user selects addition or subtraction then your code must ask the user to enter the elements
for 2 matrices, otherwise ask the user to enter the elements for only one matrix.
• If user presses a wrong character, ask him/her to input again.
Suppose that there is only 1kb space is left on stack, but you want to input the marks for 100 students
and calculate their average. Write an efficient C++ program to complete the task.
program in which each destructor should display different message e.g. for object 1 the message should be like this: “Object 1 is going to destroy”
Write a C++ program to create a new file named “college.txt” to store list of colleges under Punjab university. Read names of 3 colleges (consider input given below) from console and store it in “college.txt”. Further copy contents of “college.txt” in another file “university.txt”. Now open the “university.txt” file and display the following (underlined) characters on console using file manipulation functions.
Input:
Lovely Professional University
Thapar Institute of Engineering and Technology
Dr B R Ambedkar National Institute of Technology
Write a C++ program to create a new file named “college.txt” to store list of colleges under Punjab
university. Read names of 3 colleges (consider input given below) from console and store it in
“college.txt”. Further copy contents of “college.txt” in another file “university.txt”. Now open the
“university.txt” file and display the following (underlined) characters on console using file
manipulation functions.
Input:
Lovely Professional University
Thapar Institute of Engineering and Technology
Dr B R Ambedkar National Institute of Technology