1. The program should initialize with two variables, one called balance that starts with a float of 0, and one called otherBalance that also starts with a float of 0. [5% marks] 2. Create the following functions: i) getBalance() [5% marks] ■ This should only return the value of balance ii) getOtherBalance() [5% marks] ■ This should only return the value of otherBalance iii) printBalances() [10% marks] ■ This should call getBalance() and getOtherBalance(), and print the returned values out with a dollar symbol and two decimal places (i.e., $10.99) (Hint: you can use format() function here to print the returned values) iv) deposit(money) [15% marks]
Alphabetic Symbol
Write a program to print the right alphabetic triangle up to the given N rows.Input
The input will be a single line containing a positive integer (N).Output
The output should be N rows with letters.
Note: There is a space after each letter.Explanation
For example, if the given number of rows is 4,
your code should print the following pattern.
A
A B
A B C
A B C DSample Input 1
4
Sample Output 1
A
A B
A B C
A B C D
Sample Input 2
6
Sample Output 2
A
A B
A B C
A B C D
A B C D E
A B C D E F
Right Triangle
Given a number N, write a program to print a triangular pattern of N lines with numbers as shown below.Input
The input will be a single line containing a positive integer (N).Output
The output should be N rows with numbers.
Note: There is no space between the numbers.Explanation
For example, if the given number of rows is 4,
your code should print the following pattern
1
121
12321
1234321Sample Input 1
4
Sample Output 1
1
121
12321
1234321
Sample Input 2
9
Sample Output 2
1
121
12321
1234321
123454321
12345654321
1234567654321
123456787654321
12345678987654321
Create a c structure to represent a rectangle with width and height. Create a rectangle object and find the perimeter of the rectangle
Evens and Odds
Write a program to count even and odd numbers in given range [M, N]. Both M, N are inclusive in [M, N].
Input
The first line of the input will be an integer(M).
The Second line of the input will be an integer(N).
Output
The first line of output should be a number of odds count.
The second line of output should be a number of even counts.
Explanation
For example, if the given range is 2 to 11
odds numbers in the range are 3, 5, 7, 9, 11 then count is 5.
even numbers in the range are 2, 4, 6, 8, 10 then count is 5.
Sample Input 1
2
11
Sample Output 1
5
5
Sample Input 2
-5
7
Sample Output 2
7
6
Write a program that follows the below rules: Scenario 1:Your friend is going to be another 15 minutes or more
Result: If you have more than 5 AED in change, go buy a coffee, otherwise go for a walk around the town
Scenario 2: Your friend is going to with you in less than 15 minutes
Result: Sit in the food zone and wait
You want to start a two-piece band, but first you need a friend to join it. If you have a musical friend, you next need to check (using a nested ifstatement) that they actually play an instrument you want in the band. You decide that they need to play either guitar or drums to join.
Write a program that checks to see if you can start a band! You should use the following variables to write your program:
bool musicalFriend = true; string friendPlays = "guitar";
Ordered Matrix
Given a M x N matrix, write a program to print the matrix after ordering all the elements of the matrix in increasing order.Input
The first line of input will contain two space-separated integers, denoting the M and N.
The next M following lines will contain N space-separated integers, denoting the elements of each list.Output
The output should be M lines containing the ordered matrix.
Note: There is a space at the end of each line.Explanation
For example, if the given M is 3 and N is 3, read the inputs in the next three lines if the numbers given in the next three lines are the following.
1 20 3
30 10 2
5 11 15By ordering all the elements of the matrix in increasing order, the ordered matrix should be
1 2 3
5 10 11
15 20 30Sample Input 1
3 3
1 20 3
30 10 2
5 11 15
Sample Output 1
1 2 3
5 10 11
15 20 30
Sample Input 2
2 5
-50 20 3 25 -20
88 17 38 72 -10
Sample