Reference no: EM131268727
Plan each program by writing pseudocode.
Write all lines of your pseudocode as comments immediately.
Add more comments in each program to explain what your code is doing.
Choose descriptive variable names in all programs.
1. Write a program called program41.py that uses a for loop and the range functionto output the numbers from 5 up to 100 by fives exactly as shown (all numbers all on the same line, separated by a single space). Output "That's that!" (note apostrophe) on a new line to end the program as shown below.
SAMPLE RUN
5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100
That's that!
2. Write another program called program42.py that generates exactly the same output as the program above, but by using a while loop.
3. Write a program named program43.py that uses nested loops to generate a triangle as shown in the sample run. The program should begin by prompting the user to enter the number of lines in the triangle.
4. Write a program named program44.py that can be used to determine the average of some integers. The number of integers can vary, and this should not be initially set by user input (see sample output). Instead, use a while loop and a sentinel value of zero to cease integer input. Display the average accurate to two decimal places.
SAMPLE RUN
Enter integer 12
Enter integer 9
Enter integer 8
Enter integer 14
Enter integer 0
The average is 10.75
Method that returns the number of consonants
: Write a class with a constructor that accepts a String object as its argument. The class should have a method that returns the number of vowels in the string, and another method that returns the number of consonants in the string. Demonstrate the ..
|
Input two arrays of information
: Write a program that will input two arrays of information. Each array will contain exactly 4floating point values. Your program will enter these values from standard input.
|
Malloc up space for a one-dimensional array of n integers
: Write a program that will first read in a positive integer number, say n, from standard input. Then you need to create enough space in the heap via a call to malloc to hold an array of n integers.You then need to use array index operators to fill ..
|
How fast is its daily cost for hamburgers increasing
: If the restaurant s daily sales are increasing at the rate of 30 hamburgers per day, how fast is its daily cost for hamburgers increasing?
|
Determine the average of some integers
: Write a program named program43.py that uses nested loops to generate a triangle as shown in the sample run. The program should begin by prompting the user to enter the number of lines in the triangle.
|
How fast is its daily cost for hamburgers increasing
: If the restaurant s daily sales are increasing at the rate of 30 hamburgers per day, how fast is its daily cost for hamburgers increasing?
|
What requirements must a public-key cryptosystems
: 1. What requirements must a public-key cryptosystems fulfill to be a secure algorithm? 2. In the SHA-512 hash function,
|
Evaluate the volatility risks in the fund
: Evaluate the volatility risks in the fund, providing an assessment of the fund manager's performance based on the risk measurements for the fund. Make a recommendation to the fund manager for improving the performance.
|
Information security standard or compliance law
: As a group, decide on an Information Security Standard or Compliance Law that is applicable to your hypothetical Fortune 500 company. Explain to your CTO what the rule/law is and what your organization needs to do to ensure compliance.
|