Write a program to print a parallelogram pattern with * characters. The size N represents the length (the number of * characters in each line)& breadth ( the number of lines) of the parallelogram.
The slope of the parallelogram T represents the number of extra spaces a line should have in the beginning compared to its next line. The last line of the pattern does not have any spaces in the beginning.
Explanation:
Given N=3 and T=2, each line should have 3 star(*) characters.
The last line should have 0 spaces at the beginning.
Each line has 2 extra spaces characters when compared to its next line.
Sample Input1
2
2
Sample Output1
**
**
Sample Input2
3
2
Sample Output2
***
***
***
You given a list of prices where prices[i] is the price of a given stock o the i th day write a program to print the maximum profit by choosing a single day to buy a stock and choosing a different day in the future to sell that stock if these is no profit that can be achieved return 0.
Input
The input is a single line containing space seperated integers.
Output
The output should be a single line integer.
Explanation
In the example the given prices are 7 1 5 3 6 4.
buying stocks on day two having price 1 and selling them on the fifth day having price 6 would give the maximum profit which is 6 - 1
so the output should be 5.
Sample Input1
1 2 1 3 6 7 4
Sample Output1
6
Explain how overloading a unary operator is almost similar to overloading a binary operator with necessary examples and include main() function to demonstrate. Mention the differences between these two in terms of number of operands they deal with.
Explain how overloading a unary operator is almost similar to overloading a binary operator with necessary examples and include main() function to demonstrate. Mention the differences between these two in terms of number of operands they deal with.
Student Record Management System
Write a C++ program which perform following operations:
Insert student record in a csv file comma separated value.
Insert at Start
Insert at End
Insert at Specific Position
Update student record (update name) in a csv file comma separated value.
Delete student record (delete by name) in a csv file comma separated value.
Student records consist of Name, age and contact number (comma separated data).
Each row of file contains a record of the student.
Example:
StudentInfo.txt
Ali ahmad,19,0333-1234567
Bilal malik,21,0321-1234567
Write a menu base program with the following menu:
Press 1 for insert student record in a csv file comma separated value
Press 2 for update student record in a csv file comma separated value
Press 3 for delete student record in a csv file comma separated value
Press 4 for display all student records of a csv file comma separated value
Press 5 for terminate the program
write a program to add three find factorial using class
Write a program to overload operators in the same program by writing suitable operator friend functions for following expression:
O7=((O1>=O2) +(O3 && O4) *(O5<O6)) [Here O1,O2,O3,O4,O5,O6 and O7 are objects of a class “overloading”, and this class is having one integer data member]
Using an appropriate diagram: Discuss Gates & Flip Flops in Microprocessors
Write a program to perform class to basic conversion [Such as: Class is: Triangle with data members base and height(float), and basic type is float(area of triangle)].
Write a program to take input for n book records from user and write those book records in a file named: ”record”, whose price is less than INR 500 . Program should also perform random access in the file, after taking input for a particular record number to read and it should also perform random record overwriting after taking input of new record and the record number to overwrite. After overwriting record, display all records on the screen [Attributes of book: Book_id, Book_price, Book_name, Book_author_name]