Write a program to assist a college student in selecting an appropriate humanities or social science course as part of their degree.The college maintains a list of approved transfer courses that are available for AAS degrees like Computer Technology.use the following as eligible courses:
Social science Humanities
ECO 210ART 101
GEO 101ENG 102
SOC 101MUS 105
PSY 201PHI 101
HIS 101REL 101
PSC 201
Create 2 lists for social science and humanities courses.Ask a student the course number they would like to take to fulfill the social science requirement.Search your list to see if the course is an acceptable course in that category.If so tell them the course they selected is fine.If not tell them that the course is not eligible and then display for them all the eligible courses.Repeat the same structure for humanities courses.The program should work for any number of courses in the lists
Fibonacci numbers are a sequence of integers, starting with 1, where the value of each number is the sum of the two previous numbers, e.g. 1, 1, 2, 3, 5, 8, etc. Write a function called fibonacci that takes a parameter, n, which contains an integer value, and have it return the nth Fibonacci number. (There are two ways to do this: one with recursion, and one without.)
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
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
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
IPL
A win earns a team 3 points. A draw earns 1. A loss earns 0.
The following information is expected:
MP: Matches Played
W: Matches Won
D: Matches Drawn (Tied)
L: Matches Lost
P: Points
The team information should be displayed in descending order of points.Input
Each of those lines has information on the T1, T2) which played and the outcome (O) in format T1;T2;O.
The outcome (O) is one of 'win', 'loss', 'draw' and refers to the first team listed.
See Sample Input/Output for better understanding.
CSK, Matches Played: 4, Won: 2, Lost: 1, Draw: 1, Points: 7' for each team in a new line.
If there are no teams to print in summary, print "No Output".
Constraints
Names of teams may contain spaces but will be less than 24 characters
100 >= N >= 0
Sample Input
6
CSK;RR;loss
RR;DD;draw
MI;KKR;win
KKR;RR;loss
CSK;DD;draw
MI;DD;draw
Sample Output
Team: RR, Matches Played: 3, Won: 2, Lost: 0, Draw: 1, Points: 7
Team: MI, Matches Played: 2, Won: 1, Lost: 0, Draw: 1, Points: 4
Input
The first line contains a single integer M.
Next M lines contain two integers Pi, Ci separated with space, where Pi denotes power and Ci denotes co-efficient of Pi for polynomial A.
After that next line contains a single integer N. Next N lines contain two integers Pj, Cj separated with space, where
Pj denotes power and Cj denotes co-efficient of Pj for polynomial B.
Output
Print the addition of polynomials A and B.
The format for printing polynomials is: Cix^Pi + Ci-1x^Pi-1 + ... + C1x + CO, where Pi's are powers in decreasing order, Ci is co-efficient and CO is constant, there will be space before and after the plus or
minus sign. If co-efficient is zero then don't print the term. If the term with highest degree is negative, the term should be
represented as -Cix^Pi. For the term where power is 1 represent it as C1x instead of C1x^1. If the degree of polynomial is zero and the constant term is also zero, then just print 0 to represent the polynomial.