Sometimes we write similar letters to different people. For example, you might write to your parents to tell them about your classes and your friends and to ask for money; you might write to a friend about your love life, your classes, and your hobbies; and you might write to your brother about your hobbies and your friends and to ask for money. Write a
Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 4 images
- Write a program that recommends the number of calories a person should eat each day. Calories are units of energy found in all foods. Base your recommendation on the person's weight and whether the person has an active or sedentary (inactive) lifestyle. If the person is sedentary, that person's activity factor is 13. If the person is active, that person's activity factor is 15. Multiply the activity factor by the person's weight to get the recommended number of calories. Start your program by: having the user enter their weight, as a floating point number; having the user enter whether they have active or sedentary lifestyle, as a character, 'A' for active or 'S' sedentary; use a switch (or else if) selection statement to use the appropriate calculation for the recommended calories for the selected lifestyle. print out your results on the screen.arrow_forwardWe want to create a program that draws a diamond or a triangle with a size that the user selects using a specific character that will be entered at the keyboard. Here are two examples: A triangle of size 4, using *: *** ***** ****** * A diamond of size 4, using *: *** ***** ******* ***** *** * What do we need for this program? Problem definition We first need to clearly define the problem, the inputs and the outputs. Inputs: 1) a choice to draw one of the two shapes or to quit the program, 2) a character choice which will be used for drawing the selected shape, and 3) the size of the shape Output: One of these will be the output: 1) a triangle, 2) a diamond,arrow_forwardWrite a program to print the lyrics for ten verses of "The Ants Go March-ing." A couple of sample verses are given below. You may choose your own activity for the "little one" in each verse, but be sure to choose somethingthat makes the rhyme work (or almost work). The ants go marching one by one, hurrah! hurrah!The ants go marching one by one, hurrah! hurrah!The ants go marching one by one,The little one stops to suck his thumb,And they all go marching down ...In the ground ...To get out ....Of the rain.Boom! Boom! Boom!The ants go marching two by two, hurrah! hurrah!The ants go marching two by two, hurrah! hurrah!The ants go marching two by two,The little one stops to tie his shoe,And they all go marching down ...In the ground ...To get out ...Of the rain.Boom! Boom! Boom!arrow_forward
- Write a program that allows a player to play Rock, Paper, and Scissors against the computer. In this version, if there is a tie the computer wins. The user must beat the computer to win around.The player will provide their name and the number of rounds they want to play. They will begin by entering their name and the number of rounds they would like to play. For each round, the player will input a character to represent their play (‘R’ for rock, ‘P’ for paper, or ‘S’ for scissors). The program will randomly select its play and output whether the player won or lost. After all, rounds have been completed the program will output the match-winner. In the case that the player wins the match, it will output their percentage of wins otherwise it will output the percentage of losses. Use the following functions / descriptions for your code. You may (should) add more functions as you deem necessary, but you may not omit or modify the functionality described below (Don’t forget you will also…arrow_forwardWhen we say arithmetic expression, we mean a kind of expression you can type in a very basic desk calculator. That is, neither variables nor brackets are allowed. It contains only numbers and four arithmetic operators, +, -, *, and /. The following are some examples of arithmetic expression: Any number string with or without signs - e.g. 3, -1, +10, 3.14, -0.70 and 099. Number strings mixed with arithmetic operators - e.g. 3+5, -1+2*3, 7/10-0.7, and -1.4-+8.2. An example of FA diagram for recognising a non-negative integer is given below. You may use it as a start point. You need to add a few more states and transitions to handle numbers with decimal point and signs (e.g. -5, +2, 0.21, -32.6, +99.05, but not the form 1.0E-3). Most importantly, you also need to add a few more things to deal with the arithmetic operators +, -, *, /.arrow_forwardWrite a python program of the following using the modification of the second picturearrow_forward
- I need help with creating a Java program based with the loop methods:arrow_forwardThe ideal gas law allows the calculation of volume of a gas given the pressure(P), amount of the gas (n), and the temperature (T). The equation is:V = nRT / PSince we only have used integer arithmetic, all numbers will be integer values with no decimal points. The constant R is 8.314 and will be specified as (8314/1000). This gives the same result. Implement the idea gas law program where the user is prompted for and enters values for n, T, and P, and V is calculated and printed out. Be careful to implement an accurate version of this program. Your program should include a proper and useful prompt for input, and print the results in a meaningful manner.arrow_forwardPython questionarrow_forward
- flowchart of Many treadmills output the speed of the treadmill in miles per hour (mph) on the console, but most runners think of speed in terms of a pace. A common pace is the number of minutes and seconds per mile instead of mph. You want to solve this problem by developing a program. Your program startswith a quantity in mph and converts the quantity into minutes and seconds per mile. As an example, the proper output for an input of 6.5 mph should be 9 minutes and 13.8 seconds per mile.arrow_forwardWrite a program that prompts the user to enter apoint (x, y) and checks whether the point is within the rectangle centred at (1, 1)with width 10 and height 5. For example, (2, 2) is inside the rectangle and (6, 4)is outside the rectangle, as shown in Figure . (Hint: A point is in the rectangleif its horizontal distance to (0, 0) is less than or equal to 10 / 2 and its verticaldistance to (0, 0) is less than or equal to 5.0 / 2. Test your program to cover allcases.) Here are two sample runs. Enter a point with two coordinates: 2 2 ↵EnterPoint (2.0, 2.0) is in the rectanglearrow_forwardWrite a program that compares the area of two rectangles. You can do this several ways, one way is to add the length and width of each rectangle to get it's area and then compare the two areas together. The program should ask for the length and width of two rectangles and then tell the user which rectangle has the greater area, or if the areas are the same. The area of a rectangle is the rectangle's length times its width. Name the source code file yourName_HW4.py. Test and run the program. Capture the output console and save it as an image file namedarrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY