Posted at 16:13h
in
Uncategorized
by admin
Question:
You are given a string . Suppose a character ‘a’ occurs consecutively n times in the string. Replace these consecutive occurrences of the character ‘a’ with (n, ‘a’) in the string.
Input Format: A single line of input consisting of the string .
Output Format: A single line of...
Posted at 00:46h
in
archives
by admin
Question 1.
Write a program to print a multiplication table (a times table). At the start, it should ask the user which table to print. The output should look something like this:
Sample Input:
Which multiplication table would you like? 5
Sample Output:
Here’s your table:
5 x 1 = 5
5 x 2...
Posted at 00:42h
in
Uncategorized
by admin
Question:
Write a function luckySum(a, b, c) to calculate sum of given 3 int values, a b c. The function will have a return value of their sum. However, if one of the values is 13 then it does not count towards the sum and values to its...
Problem DescriptionBarbara plants N different sunflowers, each with a unique height, ordered from smallest to largest, and records their heights for N consecutive days. Each day, all of her flowers grow taller than they were the day before.
She records each of these measurements in a...
Posted at 00:33h
in
archives
by admin
Question:
Please write a program using function. Each player in a tournament plays six games. There are no ties. The tournament director places the players in groups based on the results of games as follows:
if a player wins 5 or 6 games, they are placed...
Posted at 00:29h
in
Uncategorized
by admin
Problem DescriptionAnna and Jack are playing a game.
Each player starts with 100 points. The game uses standard six-sided dice and is played in rounds. During one round, each player rolls one die. The player with the lower roll loses the number of points shown on...