Design a program that lets the user enter the total rainfall

4.11. Calculating the Factorial of a Number - Python

Write a program in Python that lets the user enter the total rainfall for each of 12 months into a list. The program should calculate and display the total rainfall for the year, the average monthly rainfall, the months with the highest and lowest amounts. Questions are typically answered within 1 hour.

Programming logic and design

Explain various access specifiers? Data hidi Q: Design a combinational circuit with three inputs x, y, z, and three outputs a, b, and c. When the bi A: Below is the truth table that full-fill the given relationship among the inputs x, y, z and outputs Q: Hi, I am programming in java.

The instructions require: Create a new project and call it Project8. Q: Given the follwing business rules, create an ERD. The ERD must include all primary keys, foreign ke A: The entities, primary keys and foreign keys and attributes of ERD are:. Prompt the user for a question, and randomly s Q: When a full backup or system state backup is performed on a CA server, the certificate store is back A: The given statement is true i.

The certificate store is backed up together with other data when a Operations Management. Chemical Engineering. Civil Engineering. Computer Engineering. Computer Science. Electrical Engineering. Mechanical Engineering. Advanced Math.

Powerapps set value

Advanced Physics. Earth Science.By using our site, you acknowledge that you have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. I am trying to figure out some homework for an intro to programming class. It seems I have gone the long way around finding most of the info.

I have to design a program that takes a user input for total rainfall for each of the 12 months. It should calculate and display the total rainfall for the year, average rainfall, and the months with the highest and lowest amounts.

I can get my program to do everything but display the month name with the highest and lowest. Like I mentioned before I know I have taken the long way on this and it is more than likely not the most efficient path. Here is my code. When I do this I get my input prompts, the min, the max, the total, and the average. I'm just not sure where to get the month names for the min and max.

If there is a quicker way I'm all for it as well. Then use the index of the returned value in any given function to get the month name from the other list, e. Edit: You added the requirement of no dictionaries, but I left my answer in case it is useful to others.

If dictionaries can't be used you could implement a similar logic with a different data representation for the elements in the list. You could put it in the format "Jan The code in that case would be something like this:.

Chemtrails nanoparticles

Learn more. Python-Rainfall Statistics Ask Question. Asked 6 years, 10 months ago. Active 6 years, 10 months ago. Viewed 9k times. FreddieB FreddieB 5 1 1 silver badge 3 3 bronze badges.They are ok. If the first element in array is say the ONLY number you have, isn't it not only the largest but the smallest??

Trending News. Trump turns power of state against his political rivals. How 'secretly in love' bandmates finally came out. Jane Fonda gives candid response to sex question. Fed-up Black Americans look to quit the U. Unreal kick might be best UFC knockout ever. North Korea unveils new weapons at military parade. The undocumented Latina leading a massive movement. Ex-Obama adviser: Covid infections 'going to go up'.

Girl, 3, falls into scalding water at Yellowstone.

Subscribe to RSS

Program Requirements: Input validation: Do not accept negative numbers for monthly rainfall figures. Implement two functions in the program: float getTotal float [ ], int ; This function calculates and returns the total of the values stored in the array parameter.

The size paramter indicates the number of elements in the array. The size parameter indicates the number ofelements in the array. Sample output Enter the rainfall in inches for month 1: 12 Enter the rainfall in inches for month 2: 5 Enter the rainfall in inches for month 3: 6 Enter the rainfall in inches for month 4: 2 Enter the rainfall in inches for month 5: 7 Enter the rainfall in inches for month 6: 8 Enter the rainfall in inches for month 7: 10 Enter the rainfall in inches for month 8: 13 Enter the rainfall in inches for month 9: 6 Enter the rainfall in inches for month 5 Enter the rainfall in inches for month 0 Enter the rainfall in inches for month 1 The total rainfall for the year is The average rainfall for the year is 6.

The largest amount of rainfall was The smallest amount of rainfall was 0. I do not know the steps to converting this to implementing it into the two functions required?

Answer Save. I am looking at the functions. So, with that said, use the if for smallest in same for loop. As for functions. They gave you it no? Look float getTotal float [ ], int ; takes the array of amounts and the size. Return total. But remember, you used double and this is float.By using our site, you acknowledge that you have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service.

Kubota l2501 quick hitch

Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. I am supposed to design a program that lets the user enter the total rainfall for each of the 12 months into an array.

The program should calculate and display the total rainfall for the year, the average monthly rainfall, and the months with the highest and lowest amounts. It keeps saying I cannot use a keyword as an expression, I have been staring at it for over an hour now I may have looked over something.

I can't reproduce the error you mention, but your code seems to be confused in a way that's a bit too big to explain as a comment. You seem to be using a mix of Python 2 and Python 3 code, which won't work - for example, you seem to expect this:. In Python 2, it prints this:. This happens because the comma suppressed the newline in Python 2, but the brackets weren't part of the statement - so, you're telling it to print a one-item tuple.

In Python 3, it is a normal function call so the brackets are part of itand you can tell it to put an arbitrary string at the end after it has done printing - it defaults to a newline, but you can change it to, say, a space like this:.

In Python 2, it will. In Python 3, it won't do anything - you need to call the function now:. The rest of your code assumes that each months[index] will be a number, so that:. When num which comes from months is a string, you actually get an error. The way around this is to tell Python to turn it into a number after you get it:.

Python generally gives you the line number of the error and that will be invaluable in solving this problem. By the way, I wouldn't be implementing a function like total when Python already provides a perfectly good sum which does what you want.

Learn more. Python: cannot use a keyword as an expression Ask Question. Asked 6 years, 10 months ago. Active 6 years, 10 months ago. Viewed times. John Zwinck k 27 27 gold badges silver badges bronze badges. Please don't shout even when it is done with just bold text.Design a program that lets the user enter the total rainfall for each 12 months into an array. The program should calculate and display the total rainfall for the year the average monthly rainfall, and the month with the highest and lowest amounts.

In pseudo-code and a flowchart. First Name. Your Response. Write a pseudocode to represent the logic of a program that allows a user to enter an hourly pay rate and hours worked.

The program outputs the user's gross pay. Write a program that asks the user to enter the number of packages purchased. The program should then display the amount of the discount if any and the total amount of the purchase after the discount.

Your program should use a. The program outputs the age of the user this year. Preferably a. Time Calculator Write a program that asks the user to enter a number of seconds. If the number of seconds entered by the user is greater than or equal to 60, the program should display the. You can convert. I am having. Draw the hierarchy chart and design the logic for a program that calculates the projected cost of an automobile trip.

Assume that the user's car travels 20 miles per gallon of gas.

Churn rate in tableau

Design a program that prompts the user for a. Design the pseudocode for a program that allows a user to enter 10 numbers, then displays them in the reverse order of their entry. Design a retirement planning calculator for Skulling Fincancial Services. Allo a user to enter a number of working years remaining in the user's career and the annual amount of money the user can save.

Assume that the user earns. Design a program in pseudocode that calculates the amount of money a person would earn over a period of time if their salary is one penny the first day, and then doubles each day.

The program should ask the user for the number of. Write a program which allows user to enter 10 student names and scores for Java programming 1 and Java programming 2. Allow user to choose which course they want to enter the record for.If it succeeds, more people will see my tips, will join the discussion and eventually, connect with me.

So, today I posted my first betting tip. My first attempt to publish a betting tip failed miserably. This is the message I got when I clicked on the publish button, after spending at least half an hour to learn the whereabouts of the post tip form. I moved on and found another game I was happy to give out a tip for.

It was the friendly game between Mechelen and Oud-Heverlee. Load the so-called post tip form. By making the appropriate selection, the rest of the fields are automatically filled with the corresponding details. Next comes our prediction. Describe your betting tip. You also have to decide the bookmaker you are preferring to bet with.

Although it makes no sense to me to choose a bookmaker with lower odds than the competition, you still have a variety of choice. Finally, pick your stake from a scale of 1 to 10. My choice is always flat betting and I elect the maximum stake available. They just pick tens of games so that they can brag when they succeed in some of them later on. BettingExpert does an excellent job here as far as I am concerned, driving away the less talkative tipsters.

True, if you want to be remembered as a social network, you need communicative members in your network. Time to publish your tip. By now you must have spent at least 5 or so minutes, filling the form. Pay attention to every detail you see at this page.Once you have proven that your betting tips are profitable you can start selling tips and earn money. We have many free and paid tipsters that are profitable over long periods of time.

You just need to pick the ones that you want to follow and set one of our automated solutions to place bets automatically for you. If you decide to post your own tips then with our analysis services you will be able to find best staking plan for your betting tips.

Cristianesimo e paganesimo celtico in scozia

You can apply different staking plans to your tipping history and within seconds find staking plan that would create you biggest profits and minimum risk. We have automated whole process, from notifying your followers to actual bet placement at biggest betting exchange. Picking your selections and placing bets can take hours of your time each day. Bet placement process is prone to mistakes and is hard to follow, specially if you are using staking plan. If you run tipster service then you also need to notify all your subscribers and then they all need to follow your tips and place bets.

Our system will notify all your subscribers automatically when you add new tip. We can help you and your subscribers setup betting bot that will place bets on all your tips automatically at most popular betting exchanges.

Your single click to add new tip will trigger notifications to all your subscribers betting bots that will place bets automatically just before event starts.

If your tips are creating regular monthly profits then best thing that you can do is to start selling your tips. Proven tipsters whose betting tips create regular monthly profits can make their tips private and start selling their services to other users. All you need to do is to register and prove that your tips are profitable. After that contact us for details to set your account. Toggle navigation Tipping Tipsters All active tips All settled tips Live blog Buy betting tips Sell betting tips Betting Betting bank Automated betting VPS - Virtual Private Server Staking plans Fibonacci staking plan Martingale staking plan Odds staking ladder Parlay staking plan Percent of betting bank Up down staking plan Labouchere staking plan Reverse Labouchere staking Square root staking Lay 1-4 staking Kelly staking Retirement staking Best offers Help FAQ Betting terminology About Contact Login Register Place your betting tips or follow other profitable tipsters FREE TIPS TIPSTERS Automatic betting on your tips Automatic notifications when new tips are placed REGISTER Prove that your tipping is profitable and start selling your tips.

REGISTER Free and paid tipping services Follow free tipsters or subscribe to tipsters that have proven records. Notify your followers When you add new tips your followers will be notified by email, Twitter messages or by using unique link that lists tips in machine friendly format. Automated betting on your tips TippingSports is approved Betfair API solution which means that you can set it to automatically bet on all your tips and tips from your tipsters at Betfair. Sell your tips With long and profitable tipping history you can sell your tips to your followers and earn extra money.

FREE AND PAID TIPPING SERVICES Publish your tips and follow other tipsters By registering you will be able to publish your tips and follow other tipsters betting tips. By using our services you will have all this fully automated. From Betting on Horse Racing For DummiesPeople have been betting on horse races since horses have been running. Betting on Horse Racing For Dummies offers lots of info to help better your odds including advice on what to pay attention to and what tools can help you at the track as well as the mechanics of placing a bet, the types of bets you can place, and your odds of winning.

The following list spells out the betting procedure step by step:You can bet on a single horse to win, place, or show or on a combination of horses. Along with your sunscreen (or umbrella. You may want binoculars to see your favorite pass the finish line, but the tools in the following list are even more useful when it comes to actually placing your bets:Racetrack program: Like a program at a baseball game, it has information on all the players.