Suppose that the rent for an apartment is $1000 per month this year and increases 3% every year. Write a C++ program that computes the rent in five years and the total rent for one year starting five years from now
Samurais are so awesome! I'd like to imitate their amazing sword skills some time but I just don't have the courage to harm myself, so I'd just like to print out three forward slashes (\) to digitally imitate the samurai's triple slash skill. Haha!
Sounds easy, right? Then code it now!
Output
Three lines with a single forward slash symbol.
years,weeks & days
Given N number of days as input , write a program to convert N number of days to years ( ( Y ) weeks ( W ) and days ( D ).
NOTE :Take 1 year = 365 days.
input
the input contain single line integer N .
output
print space-separated integers Y , W and D.
Explanation
Given N =1329 . th value can be written as 1329 = 3 years +33 weeks + 3 days
so the output should be 3 33 3 .
sample input 1
1329
sample output 1
3
33
3
sample input 1
sample output 1
Women population
in a town, the percentage of men is 52 and the rest are women ( W ).the total population ( T ) of town is given as input.
write a program to print the total number of women in the town.
Input
the first line of input is an integer T .
output
the output should be an integer representing the total number of women in the town.
explanation
given total population 80000 . then the number of women should 80000*48/100=38400
so the output should be 38400 .
sample input 1
80000
sample output 1
38400
sample input 2
100000
sample output 1
48000
from karel.stanfordkarel import *
"""
Your job in the assignment is to add the necessary code to
instruct Karel to walk to the door of its house, pick up the
newspaper (represented by a beeper, of course), and then return
to its initial position in the upper left corner of the house.
"""
def main():
"""
You should write your code to make Karel do its task in
this function. Make sure to delete the 'pass' line before
starting to write your own code. You should also delete this
comment and replace it with a better, more descriptive one.
"""
pass
# There is no need to edit code beyond this point
if __name__ == "__main__":
run_karel_program()
from karel.stanfordkarel import *
"""
Your job in the assignment is to add the necessary code to
instruct Karel to put beeper at the four corner of the room
and return to its original position at bottom left.
"""
def main():
"""
You should write your code to make Karel do its task in
this function. Make sure to delete the 'pass' line before
starting to write your own code. You should also delete this
comment and replace it with a better, more descriptive one.
"""
pass
# There is no need to edit code beyond this point
if __name__ == "__main__":
run_karel_program()
Using the do…while() loop, continuously scan for random integers, but add up only all the positive integers and store the total in one variable.
The loop shall only be terminated when the inputted integer is zero. Afterwards, print out the total of all inputted positive integers.
We Filipinos are quite known for the habit of leaving at least one of the many pieces of food on the plate as it can't be equally divided among all at most times. Just like when 3 people decide to eat a pizza of 10 slices, there will often be at least one slice left on the box. To accurately show just how many pieces of things are left when divided by a certain number, we code it using modulo.
Care to do it for me?
Input
A line containing two integers separated by a space.
10 3
Output
A single line containing an integer.
1
6. Three Lines Apart
by CodeChum Admin
Do you like reading books? If you do, then you must have encountered texts that have quite a wide space with dots in between them, just like pausing or thinking before proceeding the narration. Let's try doing that here in Python, shall we?
Input
Two lines containing a string on each.
some string
another string
Output
The first line contains the first inputted string.
The next three lines contains a dot symbol on each.
The last line contains the second inputted string.
some string
.
.
.
another string
1. Write a Java program to rearrange a given array of unique elements such that every second element of the array is greater than its left and right elements.
Example:
Input :
nums= { 1, 2, 4, 9, 5, 3, 8, 7, 10, 12, 14 }
Output:
Array with every second element is greater than its left and right elements:
[1, 4, 2, 9, 3, 8, 5, 10, 7, 14, 12]
2. Write a Java program to form the largest number from a given list of non-negative integers.
Example:
Input :
nums = {1, 2, 3, 0, 4, 6}
Output:
Largest number using the given array numbers: 643210
3. Write a Java program to shuffle a given array of integers.
4. Write a Java program to find maximum product of two integers in a given array of integers.
Example:
Input :
nums = { 2, 3, 5, 7, -7, 5, 8, -5 }
Output:
Pair is (7, 8), Maximum Product: 56