by CodeChum Admin
We're done dealing with days. It's time to step up and now deal with months!
Instructions:
Output
January·=·1
February·=·2
March·=·3
April·=·4
May·=·5
June·=·6
July·=·7
August·=·8
September·=·9
October·=·10
November·=·11
December·=·12
Create three arrays of type double. Do a compile-time initialization and place
different values in two of the arrays. Write a program to store the product of the
two arrays in the third array. Produce a display using the MessageBox class
that shows the contents of all three arrays using a single line for an element from
all three arrays. For an added challenge, design your solution so that the two
original arrays have a different number of elements. Use 1 as the multiplier when
you produce the third array.
Using Pointer
The students’ IDs and test answers are
stored in a file. The first entry in the file contains answers to the test in the form:
TFFTFFTTTTFFTFTFTFTT
Every other entry in the file is the student ID, followed by a blank, fol- lowed by the student’s responses. For example,
the entry:
ABC54301 TFTFTFTT TFTFTFFTTFT
indicates that the student ID is ABC54301 and the answer to question 1 is True, the answer to question 2 is False, and
so on. The exam has 20 questions, and the class has more than 150 students.
Each correct answer is awarded two points, each wrong answer gets one point deducted, and no answer gets zero
points.
Write a program that processes the test data. The output should be the student’s ID, followed by the answers, followed
by the test score, followed by the test grade. Assume the following grade scale: 90%–100%, A; 80%–89.99%, B; 70%–
79.99%, C; 60%–69.99%, D; and 0%–59.99%, F.
Use Pointer
Write a program that allows the user to enter the last names of a number of candidates in a local election and the
number of votes received by each candidate. The program should then output each candidate’s name, the number of
votes received, and the percentage of the total votes received by the candidate. Your program should also output the
winner of the election. A sample output is:
Number of Candidates: 5
Candidate Votes recieve %of total vote
Johnson 5000 25.91
Miller 4000 20.73
Duffy 6000 31.09
Robinson 2500 12.95
Ashtony 1800 9.33
Total 19300
The winner of the election is Duffy!!
Toll roads have different fees at different times of the day and on weekends. Write a function CalcToll() that has three arguments: the current hour of time (int), whether the time is morning (bool), and whether the day is a weekend (bool). The function returns the correct toll fee (double), based on the chart below.
Weekday Tolls
Weekend Tolls
Ex: The function calls below, with the given arguments, will return the following toll fees:
CalcToll(8, true, false) returns 2.95
CalcToll(1, false, false) returns 1.90
CalcToll(3, false, true) returns 2.15
CalcToll(5, true, true) returns 1.05
TIC-TAC-TOE
ravan's dream is to win the tic-tac-toe champions to accomplish this,the practices alone at home to learn the strategies in the game your task is to identify the cell where ravan should place his 3rd piece so that be wins the game Assume that each cell in the tic-tac-toe board is marked with number as shown in the table below
tic tac toe
0 1 2
3 4 5
6 7 8
input:
the 1st line of input contains two space-separated integers represetation the cells where ravan has placed his 1st two piece
i/P:
0 1
o/P: 2
i/p: 0 3
o/p:6
substring:
you are given two strings N &K your goal is to determine the smallest substring of N that contains all the characters in K If no substring present in N print No matches found
note: if a character is repeated multiple time in K your substring should also contain that character repeated the same no.of times
i/p:the 1st line input two strings N&K
input:
stealen lent
o/p:
tealen
i/p:
tomato tomatho
no matches found
Discount sale:
it is a summer discount sale in mumbai and all the local shops have put up various offers Arjun selected N items to buy while standing in the building queue,he noticed the offer "buy two !" get two FREE!".this means that for every two items he buys they give him two items for free however ,items can be of varying prices they always charge for two most costly items and give the other two as free.Arjun is confused with grouping his items to reduce the total price he has to pay your task is to find the minimum price arjun has to pay to buy all the N items
input:the 1st line contains a single integer N
the 2nd line has N space-separated integers representing the cost of items
input:
4
1 1 2 2
o/p:4
i/p:
2
10 200
output:
210
candies:
Rose bought 3 boxes of candies each box contains candies only of one specific flavor
box1:blue raspberry flavor
box2:butterscotch flavor
box3:cherry flavor
each day rose eats exactly two candies flavor(she won't eat two candies of the same flavor in a day)she won't eat more than 2 candies or 1 candy in a day .your task is to find the maximum number of days rose can keep eating candies.
input:
the 1st line input contains 3 space-separated integers A,B,C denoting the no.of blue raspberry, butterscatch and cherry candies respectively
input: 1 1 1
output:1
i/p:1 2 1
o/p:2
Write a program to print the following,
Input
The first line contains a string representing a scrambled word.
The second line contains some space-separated strings representing words guessed by the player.
Output
The output should be a single integer of the final score.
Explanation
scramble word = "tacren"
guessed words = ["trance", "recant"]
Since "trance" and "recant" both have length 6 then you score 54 pts each.
So the output is 108.
Sample Input1
tacren
trance recant
Sample Output1
108