Input Assignment
1. Take a Statement as input from user and print its first word.
2. Take a double as input from user. Cast it in int and print its value.
3. Take a char as input from user and print its ASCII value.
4. Take salary of two employees as input in float and print average of these salaries.
5. Prompt user to enter Marks in different subjects of a student and print total marks and their
percentage.
6. Prompt user to enter his name , father name , age , occupation , goal , aspirations and print a
paragraph showing details (As we did in Essay “My Self” in small classes). In short print My Self
of user.
7. Take a string as input from user and print length of its first word.
8. Take age from user and convert it in seconds and print the result.
9. Take long as input from user and print it. Do all this in a single statement using anonymous
approach.
10. Create a student class with following attributes and behaviors.
➢ Name
➢ Roll Number
➢ Fees
➢ Student count
➢ Constructors (Of All Possible combinations including Copy Constructor)
➢ Getter and Setter of all Data members
➢ calcFeeWithDiscount(int discountPercentage);
➢ calcFeeWithoutDiscount();
➢ calcAvg(int lastYearMarks , int presentYearMarks);
➢ calcPercentage(int totalMarks , int obtainMarks);
➢ print(); // To Print all data member values at once.