File Program

Downloads 1

1. Display the selection menu shown in Figure 1.
οƒΌ Processthe user’sselection using a π‘†π‘ŠπΌπ‘‡πΆπ» structure and ensure to account for lowercase and uppercase entries.
οƒΌ If the user enters A αˆΊπ‘œπ‘Ÿ π‘Žαˆ», invoke the function π‘”π‘Ÿπ‘Žπ‘‘π‘’π‘‡π‘Žπ‘π‘™π‘’αˆΊ ሻ. Once done, prompt the user again.
οƒΌ If the user enters B αˆΊπ‘œπ‘Ÿ π‘αˆ», invoke the function π‘“π‘–π‘™π‘’π‘†π‘’π‘šπ‘šπ‘Žπ‘Ÿπ‘¦αˆΊ ሻ. Once done, prompt the user again.
οƒΌ If the user enters C αˆΊπ‘œπ‘Ÿ π‘αˆ», terminate the program and print the message π‘ƒπ‘Ÿπ‘œπ‘”π‘Ÿπ‘Žπ‘š π‘‘π‘’π‘Ÿπ‘šπ‘–π‘›π‘Žπ‘‘π‘’π‘‘.
οƒΌ If the user enters another value, show an error message and PROMPT the user again. The program should never
terminate unless the user selects the exit option.
2. π‘”π‘’π‘‘πΏπ‘’π‘‘π‘‘π‘’π‘ŸπΊπ‘Ÿπ‘Žπ‘‘π‘’αˆΊ ሻ: accepts one parameter of type π‘“π‘™π‘œπ‘Žπ‘‘ and returns the corresponding letter grade as follows:
Range Letter Grade
0 59 F
60 69 D
70 79 C
80 89 B
90 100 A
Other X
3. π‘π‘Ÿπ‘–π‘›π‘‘πΊπ‘Ÿπ‘Žπ‘‘π‘’π‘‡π‘Žπ‘π‘™π‘’αˆΊ ሻ: utilizes the function π‘”π‘’π‘‘πΏπ‘’π‘‘π‘‘π‘’π‘ŸπΊπ‘Ÿπ‘Žπ‘‘π‘’αˆΊ ሻ and prints the table shown in Figure 4. You may
pick the proper column width to format and print the table.
4. π‘“π‘–π‘™π‘’π‘†π‘’π‘šπ‘šπ‘Žπ‘Ÿπ‘¦αˆΊ ሻ:
οƒΌ Open the file “grades.dat”.
οƒΌ If the file cannot be opened, display the error message “πΈπ‘Ÿπ‘Ÿπ‘œπ‘Ÿ, π‘π‘Žπ‘›π‘›π‘œπ‘‘ π‘œπ‘π‘’π‘› 𝑓𝑖𝑙𝑒: π‘”π‘Ÿπ‘Žπ‘‘π‘’π‘ . π‘‘π‘Žπ‘‘”
οƒΌ Once the file is successfully opened, print the table shown in Figure 6 and use the function π‘”π‘’π‘‘πΏπ‘’π‘‘π‘‘π‘’π‘ŸπΊπ‘Ÿπ‘Žπ‘‘π‘’αˆΊ ሻ.
οƒΌ Compute and print the π‘šπ‘–π‘›π‘–π‘šπ‘’π‘š, π‘šπ‘Žπ‘₯π‘–π‘šπ‘’π‘š, and π‘Žπ‘£π‘’π‘Ÿπ‘Žπ‘”π‘’ of all grades in the file

DietaryRestrictions

Downloads 2

You have a group of friends coming to visit for your high school reunion, and you want to take them out to eat at a local restaurant. You are not sure if any of them have dietary restrictions, but your restaurant choices are as follows:Joe’s Gourmet Burgersβ€”Vegetarian: No, Vegan: No, Gluten-Free: No
Main Street Pizza Companyβ€”Vegetarian: Yes, Vegan: No, Gluten-Free: Yes
Corner CafΓ©β€”Vegetarian: Yes, Vegan: Yes, Gluten-Free: YesWrite a program that asks whether any members of your party are vegetarian, vegan, or gluten-free, to which then displays only the restaurants to which you may take the group.Here is an example of the program’s output:Is anyone in your party a vegetarian? yes
Is anyone in your party a vegan? no
Is anyone in your party gluten-free? yesHere are your restaurant choices:
Main Street Pizza Company

all_convert cpp

Downloads 3

Write a templated function, named “all_convert”, that takes a const reference to a string and a pointer to an int. This function should convert the string to the templated type and return that. It should also adjust the int being pointed to to indicate the number of characters of the string that were converted (be sure to count leading whitespace too).You can assume that the string does not have any newline characters, and your function should ignore leading whitespace (like stoi does).

Serendipity Booksellers

Downloads 4

Python Program Description
Serendipity Booksellers has a book club that awards points to its customers based on the number of books purchased each month. The points are awarded as follows:
β€’ If a customer purchases 0 books, he or she earns 0 points.
β€’ If a customer purchases 1 book, he or she earns 5 points.
β€’ If a customer purchases 2 books, he or she earns 15 points.
β€’ If a customer purchases 3 books, he or she earns 20 points.
β€’ If a customer purchases 4 or more books, he or she earns 30 points.
Design a program that asks the user to enter the number of books that he or she has purchased this month and displays the number of points awarded.
Step 1: Create a flowchart for this program which includes:
β€’ A main module which controls the flow
β€’ A getData module which asks the user how many books were purchased
β€’ A getPoints earned module which gets the points earned based on the number of books
β€’ A displayPoints module which outputs the number of books purchased and the number of points earned.
Step 2: Use the flowchart from step 1 as a guide to writing your program in Python.

BasicInput

Downloads 5

(1) Prompt the user to input an integer, a double, a character, and a string, storing each into separate variables. Then, output those four values on a single line separated by a space. (Submit for 2 points).

Enter integer: 99
Enter double: 3.77
Enter character: z
Enter string: Howdy
99 3.77 z Howdy
(2) Extend to also output in reverse. (Submit for 1 point, so 3 points total).

Enter integer: 99
Enter double: 3.77
Enter character: z
Enter string: Howdy
99 3.77 z Howdy
Howdy z 3.77 99
(3) Extend to cast the double to an integer, and output that integer. (Submit for 2 points, so 5 points total).

Enter integer: 99
Enter double: 3.77
Enter character: z
Enter string: Howdy
99 3.77 z Howdy
Howdy z 3.77 99
3.77 cast to an integer is 3

Mad Libs

Downloads 6

Mad Libs are activities that have a person provide various words, which are then used to complete a short story in unexpected (and hopefully funny) ways.

Complete the program to read the needed values from input, that the existing output statement(s) can use to output a short story

Ex: If the input is:

Eric Chipotle 12 cars

the output is:

Eric went to Chipotle to buy 12 different types of cars.

Weights

Downloads 7

In this exercise your task is to write code that will produce a table of weights in both kilograms (kg) and pounds (lb). You should use the following conversion/( 1 kg = 2.20462 lb /)You are given a list of weights (as strings) in either kilograms or pounds, e.g.,10.0 kg
5.1 kg
52 lb
20 kg
where a space separates the weight value from the units.Your code should output a table of weights containing both kilograms and pounds. To help you we have written a function called print_row to print each row of the table. You should call this function when you wish to output a row in the table as it will format the row in the way we expect.For example, the output for the input given above should be:kg lb
10.0 22.0
5.1 11.2
23.6 52.0
20.0 44.1

Vigenere Cipher

Downloads 8

In a Vigenere cipher a plaintext message is encrypted by adding letters from a secret key (modulo 26). For example, A + X is X, B + X is Y, C + X is Z, D + X is A, etc.

Decryption is achieved by subtracting the same sequence of letters from the ciphertext. If the message is longer than the key then the letters of the key are simply repeated.

For example, given the key KEY and the message HELLO WORLD we would generate ciphertext as follows:

HELLO WORLD
KEYKE YKEYK
RIJVS UYVJN

rec_dig_sum python

Downloads 9

You will write two functions in this challenge. First write a function called rec_dig_sum that takes in an integer and returns the recursive digit sum of that number.Examples of recursive digit sums:
101 => 1+0+1 = 2
191 => 1+9+1 = 11 => 1+1 = 2
5697 => 5+6+9+7 = 27 => 2+7 = 9Then use that function within another function called distr_of_rec_digit_sums, that returns a dictionary where the keys are recursive digit sums, and the values are the counts of those digit sums occurring between a low and high (inclusive) range of input numbers. Assume low and high are positive integers where high is greater than low, and neither low nor high are negative. Your function should return a dictionary, not just print it.You can test your code as many times as you need. Your code will save if you need to come back later.
Question 2Write a function called sigmoid that implements the sigmoid logistic function, as it is shown in this article.For the value of Euler’s number e use 2.71828.Your function should return a number, not just print that number.
Write a function called sigmoid that implements the sigmoid logistic function, as it is shown in this article.For the value of Euler’s number e use 2.71828.Your function should return a number, not just print that number.

The user will enter three grades for exam

Downloads 10

The user will enter three grades for exam, project, and lab.
* The three grades entered will be stated by the program.
* The program will determine and state the highest and the lowest of grade.
* The program will state the grades above or belore 70%
* The program will calculate and display the total grade average.

×
New Download