I always want to look at the positive side of things, so I decide to seriously look at positive numbers, too!
Will you code along with me?
Instructions:
Input
1. A series of integers
Output
The first multiple lines will contain message prompts to input the integers.
The last line contains the total of all positive integers inputted.
radio_button_unchecked
Test Case 1
expand_less
No Output
Enter n: 2
Enter n: 3
Enter n: 4
Enter n: -1
Enter n: -5
Enter n: 1
Enter n: 0
Total of all positives = 10
radio_button_unchecked
Test Case 2
expand_less
No Output
Enter n: 5
Enter n: 5
Enter n: 5
Enter n: 5
Enter n: 5
Enter n: 0
Total of all positives = 25
declare two variables x and y. assign values to these variables. Number x should be printed only if it is less than 2000 or greater than 3000 and number y should be printed only if it is between 100 and 500
4. Is It You, Cody?
by CodeChum Admin
Can you identify if Cody's name is spelled right? If so, then make a program that accepts four one-letter strings separated by space and print "Correct" if the inputted strings, combined in order, spell the name Cody correctly. If not, print "Wrong". It doesn't matter if it's in uppercase or lowercase, as long as it's spelled correctly, it's considered correct.
Now, will you take on this task?
Input
A line containing four one-letter strings separated by a space.
c·O·D·y
Output
A line containing a string.
Correct
Did you know that in lotteries, a 3-digit number with the same numbers in all digits like 777 will hit the jackpot in a casino? In the same manner, let's make a program that will test if a certain 3-digit number hits a jackpot or not by identifying if all the digits of a given number is the same as the second inputted number. If it is, print "Jackpot!"; else, print "Nah".
Let's try this out now!
Input
A line containing two integers separated by a space.
777·7
Output
A line containing a string.
Jackpot!
A university's library has been having electricity issues and students have been struggling to study during the night.
Each light source can illuminate a circle with a radius of r, and there are n tables in the library and the ith table is positioned at point (xi, yi). You have to help the university find the minimum number of light sources (k), such that each table is illuminated by at least 1 light source.
Input format
• The first line contains integers n and r respectively.
• In each of the next n lines, there are two integers representing xi and yi respectively that display the position of the ith table.
Output format
• In the first line of output, print an integer k that represents the number of light sources.
For Full Instructions and Question Please Use Those Images as reference... Please help
https://drive.google.com/file/d/1wWA7nKnFWaG5XgtzzLPymfbuqiIf7WH8/view?usp=sharing
1. Write a program to enter 10 floating numbers in an array and display it.
2. Write a program to display largest and smallest element of an array defined in Q.No. 1.
3. Write a program to initialize one dimensional array of size 8 and display the sum and average of array elements
4. Write a program to read two matrices of order 3 * 2, add them and display the resultant matrix in matrix form.
5. Write a program to multiply two 3*3 matrix. 6. Write a program to read a string and check for palindrome without using string related function (a string is palindrome if its half is mirror by itself eg: abcdcba).
. Define basic algorithms to carry out an operation and outline the process of programming an application
Anbu had got lots of homework and he have to do it fast. So, he wants your help Can u help him? The problem is to find the length of the last word in the given string
Input: My Business is my Business None of your Business
Output: 8
6. Largest Digit
by CodeChum Admin
This one is a bit tricky. You're going to have to isolate each digit of the integer to determine which one is the largest, so good luck!
Instructions:
Input a 3-digit integer.
Print the largest digit in the integer.
Tip #1: Use % 10 to get the rightmost digit. For example, if you do 412 % 10, then the result would be the rightmost digit, which is 2.
Tip #2: On the other hand, use / 10 to remove the rightmost digit. For example, if you do 412 / 10, then the result would be 41.
Tip #3: You'd have to repeat Tip #1 and Tip #2 three times for this problem because the input is a 3-digit integer.
Instructions
Input one 3-digit integer.
Print the largest digit in the integer. (Hint: use % 10 to get the rightmost digit and / 10 to remove it)
Input
A line containing a three-digit integer.
173
Output
A line containing a single-digit integer
7
Given an array of integers,update every element with largest of previous and next elements with the following exception.
a)First element - check largest of first and second.
b)Last element - check largest of last and second.