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

You're a swimmer, and you want to compare all of your race times to find the fastest one. Write a program that continuously takes race times as doubles from standard input, until the input is "no more races," at which point it should print out the time of your fastest race.
Assume there are two variables, k and m, each already associated with a positive integer value and further assume that k's value is smaller than m's. Write the code necessary to compute the number of perfect squares between k and m. (A perfect square is an integer like 9, 16, 25, 36 that is equal to the square of another integer (in this case 3*3, 4*4, 5*5, 6*6 respectively).) Associate the number you compute with the variable q. For example, if k and m had the values 10 and 40 respectively, you would assign 3 to q because between 10 and 40 there are these perfect squares: 16, 25, and 36. Do NOT modify k and m.
This is what I have but I keep getting that q is incorrect
i=1
q=0
while i*i<k:
i+=1
while i*i<=m:
q+=1
i+=1
Write an if/else statement that assigns True to fever if temperature is greater than 98.6; otherwise it assigns False to fever.
Write a program that first imports the math standard library. The program then defines a function called log_e that has one parameter called power_of_e. In the function, pass the parameter to the log function of the math module and assign the returned value to a variable called exponent. The last statement in the function should return exponent.

After the function and outside the function, write a statement to read a number from the keyboard, convert it to float and assign it to a variable called my_number. Next, write a print statement that has enclosed in the print parenthesis a call to log_e passing my_number to log_e. The output should be to three decimal places using format() function.

An example of running your program is as follows:

Enter a number and I will give you it's natural logarithm: 5

1.609
Write a program that inputs the length of two pieces of fabric in feet and inches (as whole numbers) and prints the total.
Create a Flask Web Service that will generate lottery numbers. It should have the following capabilities. It should generate 6 numbers from 1-58
>All dates must be given in YYYY-MM-DD format
>Random numbers are generated with the date as the seed.
Get winning numbers from start date to end date
> URL: winning_numbers?start_date=<start_data>&end_data=<end_date>
> if start and/or end date are not defined, the default value is yesterday
> start date and end data cannot be greater than yesterday
> output is a json with this format
{
<date>: [1, 2, 3, 4, 5, 6],
<date>: [1, 2, 3, 4, 5, 6],
...
}
Write a loop that reads strings from standard input, where the string is either "duck" or "goose". The loop terminates when "goose" is read in. After the loop, your code should print out the number of "duck" strings that were read.
Adam regularly challenges one of his teachers to a pool competition. The winner of their matches is the person who wins the most individual games of pool.
Adam wishes to write a computer program to calculate the total number of times each player wins a game and display a message congratulating the winner of the overall match.
a) Adam wants the program to:
• repeatedly ask the user to input the winner of each game
• stop asking for input when the character “X” is entered
• add up the number of wins for each player as the winner of each game is inputted
• display a message congratulating the player who won the most games or display a message saying that the match was tied.
Write a program below that meets Adam’s requirements.
Write a program that inputs the length of two pieces of fabric in feet and inches (as whole numbers) and prints the total.

Enter the Feet for the first piece of fabric: 3
Enter the Inches for the first piece of fabric: 11

Enter the Feet for the second piece of fabric: 2
Enter the Inches for the second piece of fabric: 5
It displays:

Feet: 6 Inches: 4
HOW TO GET THE RIGHT CODE???

print ("Enter the Feet for the first piece of fabric: 11")
print ("Enter the Inches for the first piece of fabric: 11")
print ("Enter the Feet for the second piece of fabric: 5")
print ("Enter the Inches for the second piece of fabric: 5")
print ("Feet: 17 Inches: 4")
print ("Enter the Feet for the first piece of fabric: 4")
print ("Enter the Inches for the first piece of fabric: 5")
print ("Enter the Feet for the second piece of fabric: 7")
print ("Enter the Inches for the second piece of fabric: 6")
print ("Feet: 11 Inches: 11")
Little Arjit is in love with Deepa.They have bought a cake, and they weighed it in milligrams - the weight of the cake is always even and now they wish to divide the cake between them in some way, that both of them are satisfied.

Arjit challenges Deepa that if she can divide the weight of the cake as sum of two prime numbers between them, she can have the entire cake - and if she fails to do so, he'll get the cake.

Input Format:
The first line will contain a number, tc, denoting the number of test cases.

The next tc lines will contain an even number, denoting the weight of the cake in milligrams.

Output Format:
Print "Arjit" or "Deepa" according to the winner.

Constraints:
1 <= tc <= 100
1 <= n <= 100000
1 is NOT a prime number.
Marking Scheme: Marks are awarded if any testcase passes.
LATEST TUTORIALS
APPROVED BY CLIENTS