Problem 1:
- Write down a
program to accept user’s First and Last Name. Print full name of the user. - Print the length of the full name of the user excluding the white spaces.
- Print the length of the First Name and Last Name respectively.
Problem 2:
Write down the program that displays your mailing address as it is generally printed in your area where you live.
You do not require to take any input from the user. Mailing address can be any hypothetical address.
Problem 3:
Accept the length and width of the room in floating-point and compute the area of the room. Print area of the room including the units e.g. inch, meters, cms, feet, etc.
Problem 4:
Write a program to print the sum of n positive integers (1 to n), where n is input by the user.
You can compute summation using following formula:
Problem 5:
Create a program that reads two integers, a and b, from the user. Your program should compute and display:
- The sum of a and b
- The difference when b is subtracted from a
- The product of a and b
- The division when a is divided by b
Problem 6:
Accept any string input from the user and return every 3rd character of the string from 2nd index.
Problem 7:
Define a variable with value as following string:
“How Giving Up Refined Sugar Changed My Brain”
Print 13 characters from 17th index in reversed order of the above reversed string. Your program should not contain more than 1 variable and string value of the variable should remain intact.
Step by stepSolved in 3 steps with 1 images
- 5. A company provides loans to new college graduates based on the following conditions: The applicant must be at least 21 years old and the applicant must have had a job for at least three months. Write a program that has the user enter their age and the amount of time they've been on the job as input and lets the user know if they qualify for a loan. Focus 00 ES W C 3128 words Type here to search Oarrow_forwardIn CORAL LANGUAGE please and thank you! Summary: Given integer values for red, green, and blue, subtract the gray from each value. Computers represent color by combining the sub-colors red, green, and blue (rgb). Each sub-color's value can range from 0 to 255. Thus (255, 0, 0) is bright red, (130, 0, 130) is a medium purple, (0, 0, 0) is black, (255, 255, 255) is white, and (40, 40, 40) is a dark gray. (130, 50, 130) is a faded purple, due to the (50, 50, 50) gray part. (In other words, equal amounts of red, green, blue yield gray). Given values for red, green, and blue, remove the gray part. Ex: If the input is: 130 50 130 the output is: 80 0 80 Hint: Find the smallest value, and then subtract it from all three values, thus removing the gray.arrow_forwardYou are asked to write a Java program making a discount promotion chart for a souvenir store in Niagaraon-the-Lake, Ontario. Your discount chart should have three columns. The first column lists the items’ original price tag in CAD, and the second & third column provide the discounted prices after tax respectively in CAD and USD. All original price tags of the store are ended in .49 or .99. Your program should receive the maximum and minimum price tags, discount percentage (should be applied to original price tag), and CAD to USD exchange rate via keyboard entry. Develop you program based on the below sample results. Note that your program should check if the entries are valid values. In case of an invalid entry the program should ask the user to enter a value again as shown in the sample result. for rounding to 0.5 the round method of Math class in java.lang package might be helpful. As you may remember you do not need to import java.lang. you are only allowed to import the…arrow_forward
- Consider the following code segment. It is designed to convert letter grades to grade points. Examine the program, and identify what bug, if any, is present. if letter = "A" : gradePoints = 4.0 elif letter == "B" : of gradePoints = 3.0 elif letter == "C" : stion gradePoints = 2.0 elif letter = "D" : gradePoints = 1.0 else : gradePoints = 0.0 Select one: O There is nothing wrong with code segment (it works intended) O All instances of elif need to be replaced with else O The order of the conditions (and bodies) must be changed O The double equal signs need to be replaced with greater than or equal signs dows barrow_forward2. Write a program that takes as input two opposite corners of a rectangle: the lower left-hand corner (x1,y1) and the upper right-hand corner (x2,y2). Finally, the user is prompted for the coordinates of a third point (x,y). The program should print Boolean value True orFalse based on whether the point (x,y) lies within the rectangle.>>> ========================= RESTART=========================>>>Enter x1: 1Enter y1: 3Enter x2: 10Enter y2: 6Enter x: 4Enter y: 4True>>> ========================= RESTART=========================>>>Enter x1: 1Enter y1: 3Enter x2: 10Enter y2: 6Enter x: 4Enter y: 2Falsearrow_forwardQ1. Write a program that takes your full name as input and displays the abbreviations of the firstand middle names except the last name which is displayed as it is. For example, if your name isRobert Brett Roser, then the output should be R.B.Roser.arrow_forward
- 1. Write a program that asks the user to enter two positive integers, the height and length of a parallelogram and prints a parallelogram of that size with stars to the screen.arrow_forwardplease code in python Write a program that removes all spaces from the given input. Ex: If the input is: Hello my name is John. the output is: HellomynameisJohn. also test on: remove_spaces("This is a sentence.") remove_spaces("Look! Multiple spaces.")arrow_forwardPart 4: For circle, square and annulus write a program to find the area, perimeter (or circumference) for a range of parametric values given by the user and plot the corresponding shapes in the range given. User needs to identify lower and upper values of each parameter. The identified range for the parameters should be then divided into 10 monotonic steps inside your program. Accordingly, you need to calculate the values and plot the shapes corresponding to all 10 values in the range identified by the user. The program should plot the geometries in the first quadrant.arrow_forward
- Write a program for the HR department to define promotion strategy for every employee. The minimum salary allowed is 3,000. The maximum salary allowed is 100,000 AED. The salary increases by 10% for every 2 years for the first 6 years, and increase by 5% for every 2 years for after the first 6 years. The salary cannot exceed 100,000 AED or the double of the original salary. The program must ask the user to enter the salary and the number of years. The program then prints list of the salary increment per year.arrow_forwardProblem 1 Create a program that will print all odd integers from 1 up to a given value entered by the user. Problem 2 Write a program that will print out all the Fibonacci numbers up to a certain number of digits. Yourprogram should input the number of Fibonacci numbers to be displayed and display those values.For example if 8 was input it should display 1 1 2 3 5 8 13 21 Problem 3 Write a program that will allow us to sum all the integers from 1 up to a given number. The programwill prompt for and allow input for an integer. It will then calculate and display the sum of all integersfrom 1 to that value. Problem 4 Create a program that can be used to practice simple multiplication problems. The program shouldrandomly generate 2 single digit numbers for the user to multiply and display it in the form of aproblem. The user should enter an answer to the problem and it should check if they got it right orwrong. The program will continue asking until the user gets 3 correct answers. Problem…arrow_forwardwrite a program that reads the followinginformation and prints a payroll statement.Employee’s name (e.g., Smith)Number of hours worked in a week (e.g., 10)Hourly pay rate (e.g., 9.75)Federal tax withholding rate (e.g., 20%)State tax withholding rate (e.g., 9%) In summary, design a program to• Prompt user for 5 values and read the values using Scannero Use method .nextLine() to get the String for the nameo Use method .nextDouble() to get all other numeric values• Calculating the Gross payo Gross pay = hours worked * hourly pay rate• Calculating the Federal withholdingo Federal withholding = Gross pay * federal tax withholding rate• Calculating the State withholdingo State withholding = Gross pay * state tax withholding rate• Calculating the Total deductiono Total deduction = Federal withholding + State withholding• Calculating the Net Payo Net Pay = Gross pay – Total deduction• Formatting the output same as the Sample run (Use ONLY printf)o Correctly format 2 decimals and use $ (hint…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education