Hollow Full Pyramid - 2
Given the number of rows N, write a program to print the hallow full pyramid pattern similar to the pattern shown below.
1
1 2
1 3
1 4
1 2 3 4 5
Problem 5: Write pseudocode of a program that takes a number that represents data_Type, another
variable sign_Unsign to further classify the data type as signed or unsigned, and a number from the user.
Verify if that number can be stored in that given data type. Range of each datatype is given in the table
below.
Input:
1. Take data_Type from the user, if the user enters value other than 1 or 2 ask to input data_Type
again.
2. Take sign_Unsign from the user, if the user enters anyother value than 0 or 1 ask to input
sign_Unsign again
3. Take number (any)
Write a function that, when you call it, displays a message telling how many times it has been called: “I have been called 3 times”, for instance. Write a main() program that calls this function at least 10 times. Try implementing this function in two different ways. First, use a global variable to store the count. Second, use a local static variable. Which is more appropriate? Why can’t you use a local variable?
Write a function called swap() that interchanges two int values passed to it by the calling program. (Note that this function swaps the values of the variables in the calling program, not those in the function.) You’ll need to decide how to pass the arguments. Create a main() program to exercise the function.
Develop a program to read the name, birthday and gender of a person from a file and output the name and ten-digit national identity card (NIC) number to another file where each name is starting on a new line (see the example below). The only input to the program is the name of the file. The output of the programme is the file "output.txt". Below are the rules for forming the NIC number.
Create a product class with product name, stock balance and price as attributes. include a constructer method (_init_) and also include methods for show data, issue product and get discount. Issue product must update stock balance by reducing it by a given quantity. Get discount must calculate and return 10% of price as discount. In the main program create two product objects and pass messages.