Questions: 5 831

Answers by our Experts: 5 728

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

In a class 'N' students are asked to bring a dishes as per their roll numbers for example roll number1 brings 1 item, roll number 2 will bring 2 items and so on.write a function that that takes integer N and returns total number of items brought by "N" students. Don't use list,tuple,dictionary and use simple assignment statements,loop and if,else statement

2. Which Color?

by CodeChum Admin

My favorite color is blue. What's your favorite color? Never mind it doesn't matter, as long as you know how to identify which color is given.


Instructions:

  1. Input a string that represents a color.
  2. Print "Red" if the color is red, "Blue" if it is blue, "Green" if it is green, and "None of the Above" if it isn't any of the three colors.
  3. Inputting the strings "ReD" or "rED" should still output "Red", this also applies to the other colors, so make sure to use one of the functions discussed previously!

Input

A line containing a string.

red

Output

A line containing a string.

Red

1. Visibly Divisible

by CodeChum Admin

Do you still know what being divisible by a certain number means? In case you forgot, being divisible means that the number is capable of being divided by another number without a remainder. With this knowledge, you can surely solve this problem!


Instructions:

  1. Input one integer.
  2. Make a conditional statement that contains the following conditions:
  3. If the integer is only divisible by 3, print "Divisible by 3"
  4. If the integer is only divisible by 4, print "Divisible by 4"
  5. If the integer is divisible by both 3 and 4, print "Divisible by 3 and 4"

Input

A line containing an integer.

6

Output

A line containing a string.

Divisible·by·3







in a new game called the golden game, players collect gold coins. the players get only one chance to play and only one player play at a time. the score of each player is difines as the number of coins collected by the player. a player is called a golden player if he scores more than the players who played after her. score is called golden score if it is scored by a golden player. if your are given a list of (A) of integers representing scores of players in the order they played first to last. Write a program to print all the golden scores in the list by maintaining the relative order.



SAMPLE INPUT 1:


4 5 1 3 2


SAMPLE OUTPUT 1:


5 3 2



SAMPLE INPUT 2:


9 8 10 12


SAMPLE OUTPUT 2:


12

jeff ordered several items from an online shop. After recieving the order he found that some were faulty. So he wants to seperatethe faulty items from the rest. You are given that prices of the item Jeff ordered, where a negative sign indicates a faulty item. Write a program to shift prices of all the faulty items to the left without changing the relatie order of the input.


SAMPLE INPUT 1:

11 -12 13 -14 15 16

SAMPLE OUTPUT 1:

-12 -14 11 13 15 16


SAMPLE INPUT 2:

21 11 -3 -2 9

SAMPLE OUTPUT 2:

-3 -2 21 11 9


Did you mean: Jatin is a college student and he got his first salary from an internship. his plan is to buy one stock on a particular day and then sell it on another day. He can trade (buy & sell) the stock only once. he has one time use magic spell which he used to get the stock prices N future consecutive days. based on this information and his strategy determine the maximum profit he can make. in the given list of price, the price of stock on the ith day is denoted by prices[i]. If there is no profit that can be achieved , return 0.


SAMPLE INPUT 1:

7 1 5 3 6 4

SAMPLE OUTPUT 1:

5


SAMPLE INPUT 2:

1 11 13 21 19

SAMPLE OUTPUT 2:

20


Calasiao water district charges its customers P10 per unit for the first ten units of water consumption, P15 per unit for the next five units, and P17 for the succeeding units. Write a program that inputs the previous meter reading and the present meter reading, then display the number of units consumed and the water bill.


Create a class Person with data members name, address, age, gender. Derive class Student from Person class with data members class_enrolled, SRN. Define functions to get data and display data.

Write a function int solution(int A[], int that given an array A consisting of N integers, returns the sum of all integers which are multiples of 4

Friends

by Rhea Tortor

You task is to write a program that will continuously add friend data to a list named friends until the user enters "No". The program must display the contents of friend list.


friend's data to be collected:

Last name

First name

Birthdate

Gender

Contact No.



Validation:

Name must not be empty.

Must check the validity of the birth date.

Gender either F or M only.

Contact No. must be exactly 11 digits.


Display "Invalid input!" and ask the user to input another value.

Input

Friend's data

Tortor
Rhea
12/25/1990
F
09172345678
No

Output


Name:·Rhea·Tortor
Birthdate:·December·25,·1990
Gender:·Female
Contact·No.:·09172345678