1-write a program that reads an integer and print it in the horizontal order of the screen.
2- write a program that contains function yard to kilo() to convert yard to kilometers and to yard () kilometers to yard.
1 yard =0.9114 kilometer
3-Write a program that calculates the volume of sphere , given the radius by reading the radius from a file and write the result to another file (output.txt).
Volume=4/3Πr3
4-Write a program that asks the user to type a positive integer . when the user types a negative value the program writes ERROR and asks for another value .when the user types 0 that the last value has been typed and the program must write the average of the positive integer . if the number of typed values is zero the program writes NO AVERAGE.
5-Imagine a publishing company that markets both book and DVDs versions of its works. Create a class publication that stores the title and price of a publication . from this class derive two classes: book , which adds a page count and dvd , which adds a playing time in minutes . each of these three classes should have a getdata () function to get its data from the user at the keyboard and a putdata () function to display its data.
Write a min () program to test the book and tape class by creating instances of them , asking the user to fill in their data with getdata () and then displaying the data with putdata().
6- Start with publication , book and dvd classes as in Q5 . add a base class sales that holds an array of three floats so that it can record the dollar sales of a particular publication for the last three months . include a getdata() function to get three sales amounts from the user and a putdata () function to display the sales figures . after the book and dvd classes so they are derived from both publication and sales. An object of class book or tape should input sales data along with its other data. write main() program to create a book object and a tape and exercise their input/output capabilities.
2- write a program that contains function yard to kilo() to convert yard to kilometers and to yard () kilometers to yard.
1 yard =0.9114 kilometer
3-Write a program that calculates the volume of sphere , given the radius by reading the radius from a file and write the result to another file (output.txt).
Volume=4/3Πr3
4-Write a program that asks the user to type a positive integer . when the user types a negative value the program writes ERROR and asks for another value .when the user types 0 that the last value has been typed and the program must write the average of the positive integer . if the number of typed values is zero the program writes NO AVERAGE.
5-Imagine a publishing company that markets both book and DVDs versions of its works. Create a class publication that stores the title and price of a publication . from this class derive two classes: book , which adds a page count and dvd , which adds a playing time in minutes . each of these three classes should have a getdata () function to get its data from the user at the keyboard and a putdata () function to display its data.
Write a min () program to test the book and tape class by creating instances of them , asking the user to fill in their data with getdata () and then displaying the data with putdata().
6- Start with publication , book and dvd classes as in Q5 . add a base class sales that holds an array of three floats so that it can record the dollar sales of a particular publication for the last three months . include a getdata() function to get three sales amounts from the user and a putdata () function to display the sales figures . after the book and dvd classes so they are derived from both publication and sales. An object of class book or tape should input sales data along with its other data. write main() program to create a book object and a tape and exercise their input/output capabilities.