Using functions and other program constructs write a program that records the coursework
marks for students enrolled in HCSCI132. The coursework marks consists of three practical
assignments, one theory assignment, two tests and a mini project. The program should be
able to carry out the following operations:
a) Store marks in appropriate data types or data structures and relate the marks with the
student registration number and programme.
b) Calculate the overall coursework mark using formula;
Overall coursework mark = average practical mark * 15% + average of (theory
assignment + test marks)*15% + mini project * 10%
c) Display students who got less than half of the overall coursework i.e. 20% and below.
d) Display all student overall coursework marks ranked from the highest score to the lowest
Given the number of rows N, write a program to print the hallow diamond pattern with alphabets
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.)
Write a statement that compares the values of score1 and score2 and takes the following actions. When score1 exceeds score2, the message “player1 wins” is printed to standard out. When score2 exceeds score1, the message “player2 wins” is printed to standard out. In each case, the variables player1Wins, , player1Losses, player2Wins, and player2Losses, , are incremented when appropriate. Finally, in the event of a tie, the message “tie” is printed and the variable tieCount is incremented.
Given the variables x, y, and z, each associated with an int, write a fragment of code that assigns the smallest of these to min.
In the Happy Valley School System, children are classified by age as follows: less than 2, ineligible 2, toddler 3-5, early childhood 6-7, young reader 8-10, elementary 11 and 12, middle 13, impossible 14-16, high school 17-18, scholar greater than 18, ineligible Given an int variable age, write a switch statement that prints out, on a line by itself, the appropriate label from the above list based on age
Create and Print List -3
You are given
The first line of input is an integer
In the given example,
N=4 and the numbers are 1, 2, 3, 4. So, the output should be [ 1, 2, 3, 4 ]
Sample Input 1
4
1
2
3
4
Sample Output 1
[1, 2, 3, 4]
Sample Input 2
3
13
21
19
Sample Output 2
[13, 21, 19]
Given an MxN integer matrix, write a program to - Find all zeros and replace them with the sum of their neighbor
elements.
- After replacing the zeros, set all other elements in the corresp row and column with zeros (excluding the elements which were previously zeros).
Note: Consider the upper, lower, right and left elements as
neighboring elements.
You are given a list of prices, where given stack on the i th day.
Write a program to print the maximum profit by choosing a singl to buy a stock and choosing a different day in the future to sell stock.
If there is no profit that can be shieved, return 0