Concept explainers
Write a
Want to see the full answer?
Check out a sample textbook solutionChapter 8 Solutions
Problem Solving with C++ (10th Edition)
Additional Engineering Textbook Solutions
Starting Out with Python (3rd Edition)
Digital Fundamentals (11th Edition)
Java: An Introduction to Problem Solving and Programming (8th Edition)
Starting Out with Programming Logic and Design (4th Edition)
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
- a. A bowling team consists of five players. Each player bowls three games. Write a program that uses a nested loop to enter each player's individual scores and then computes and displays the average score for each bowler. Assume that each bowler has the following scores. Use two different loop structures for outer loop and inner loop. For example, if you use "for" as the outer loop structure, the inner loop should be "while" or "do.... while". 1st bowler: 286 2nd bowler: 212 3rd bowler: 252 232 4th bowler: 192 201 265 215 216 235 5th bowler: 186 252 186 236 272 b. Modify the program written for Exercise 3a to calculate and display the average team score. (Hint: Use a second variable to store the total of all the players' scores.)arrow_forwardForms often allow a user to enter an integer. Write a program that takes in a string representing an integer as input, and outputs yes if every character is a digit 0-9. You may assume that the string does not contain spaces and will always contain less than 50 characters. Ex: If the input is: 1995 the output is: yes Ex: If the input is: 42,000 or 1995! the output is: no Hint: Use a loop and the isdigit() function (don't forget to include the ctype library). please use c programming languagearrow_forwardIn Python lang. ONE Generate a random number between 1 and 100. That will be the number that the user should guess. Please print the random number. Generate a random number by using the random.randint function Try several times to check that the number produced is random. TWO: 0010 Create a variable and ask the user to input a number. Ask the user to input a number in a variable that will be rewritten every time the user inserts a number and Enforce the rules: Enforce that the input is a digit from 1 to 100. Give feedback to the user if the number needs to meet the rule. Allow the user to input the number again. If the number meets the rules, convert the input [a string] into an integer and evaluate if the guessed number is the same as the randomly generated number FOUR: Evaluate if the randomly generated number is the same that the number input by the user. FIVE: Use the dictionaries that you created for faculty members. Be sure that all the dictionaries have the same keys:…arrow_forward
- Write a program that will display the following pattern.arrow_forwardwrite python code to solve it thank you!arrow_forwardpython: Write a program to prompt the user for hours and rate per hour using input to compute gross pay. Pay the hourly rate for the hours up to 40 and 1.5 times the hourly rate for all hours worked above 40 hours. Use 45 hours and a rate of 10.50 per hour to test the program (the pay should be 498.75). You should use input to read a string and float() to convert the string to a number. Do not worry about error checking the user input - assume the user types numbers properly.arrow_forward
- Calculating Student Grades Help Professor Navi to calculate the average score and letter grade for his students in CS119. Write a program in Python using only conditional statements and loops(DO NOT USE FUNCTIONS) to : Ask how many students Professor Navi has in his CS119 Your program should loop asking for the following data: Ask the student name Ask for 3 exam scores. Calculate the average score. Using a bunch of IF conditions, the computer should determine the grade and display the grade to the user. Use the following Criteria: If Average is 98-100… Assign the grade “A+” If Average is 95-97.99… Assign the grade “A” If Average is 91-94.99… Assign the grade “A-” If Average is 88-90.99… Assign the grade “B+” If Average is 84-87.99… Assign the grade “B” If Average is 80-83.99… Assign the grade “B-” If Average is 75-79.99… Assign the grade “C+” If Average is 70-74.99 Assign the grade “C” If Average is less than 70 and greater than 60 assign grade “D” If Average is less…arrow_forward1 – Write a python program that prompts the user to enter a string and checks if the string contains vowels or not. If the string contains any vowels, it should print “This string contains vowels” otherwise it should print “This string does not contain any vowels”.arrow_forwardDrewa flowchart for a program for Huntersville College. The current tuition is $20,000 per year, and tuition is expected to increase by the rate that the user will input i.e. .03, .04, etc. Display the tuition each year for the next 10 years. In other words print the year number (1,2,3....) and the tuition for that year. You will have the mainline, housekeeping(), detail(), and endOfJob() modules. Remember to include the Declarations that are needed.arrow_forward
- C++ Program plsarrow_forwardin python: Prompt the user to enter a string of their choosing. Output the string. Complete the get_num_of_characters() function, which returns the number of characters in the user's string. use a for loop in this function. Extend the program by calling the get_num_of_characters() function and then output the returned result. Extend the program further by implementing the output_without_whitespace() function. output_without_whitespace() outputs the string's characters except for whitespace (spaces, tabs). Note: A tab is '\t'. Call the output_without_whitespace() function in main(). ex. Enter a sentence or phrase: The only thing we have to fear is fear itself. You entered: The only thing we have to fear is fear itself. Number of characters: 46 String with no whitespace: Theonlythingwehavetofearisfearitself.arrow_forwardPrompt 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. 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. 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. 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 #include <iostream>#include <string> // Supports use of "string" data typeusing namespace std; int main() {int userInt;double userDouble;// FIXME: Define char and string variablescout << "Enter integer:" << endl;cin >> userInt;// FIXME (1): Finish reading other items into variables, then output the four values on a single line separated by…arrow_forward
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,