Student Line-Up
A teacher has asked all her students to line up single file according to their first name. For example, in one class Amy will be at the front of the line and Yolanda will be at the end. Write a
Want to see the full answer?
Check out a sample textbook solutionChapter 5 Solutions
Starting Out With C++: Early Objects (10th Edition)
Additional Engineering Textbook Solutions
Web Development and Design Foundations with HTML5 (9th Edition) (What's New in Computer Science)
Problem Solving with C++ (9th Edition)
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
Starting out with Visual C# (4th Edition)
Introduction To Programming Using Visual Basic (11th Edition)
- Max Number Budi, Anto and Hani are playing a game called Max Number. Budi will ask Anto to say N numbers to put into a bag and also ask Hani to say M numbers and remove that number from the bag and next they will find the maximum number from the bag. Format InputThe first line contains two integers N stating total numbers that will be stored into bag and M stating the total numbers that want to be removed from the bag. The second lines contains N numbers that will be stored into the bag. The third lines contains M numbers that want to be removed from the bag. Format OutputOutput with a format “Maximum number is X”, where X is the maximum number in the bag. If no numbers in the bag, the application will give an output “Maximum number is -1” Constraints• 1 ≤ N ≤ 100• 1 ≤ M ≤ N• 1 ≤ numbers ≤ 999 Sample Input 1 (standard input)10 399 20 10 8 99 4 9 93 66 5599 94 10 Sample Output 1 (standard output)Maximum number is 93 Use C Language.arrow_forwardLap Timer Tool Write a Python (GUI program) that asks the user to enter the number of times that they have run around a racetrack, and then uses a loop to prompt them to enter the lap time for each of their laps. When the loop finishes, the program should display the time of their fastest lap, the time of their slowest lap, and their average lap time.arrow_forwardCOSC 1336 –Programming Fundamentals IProgram 6 – Repetition Structures An answer should be in Python Programing Write a program that calculates the occupancy rate for a hotel. The program should start by asking the user how many floors the hotel has. A loop should then iterate once for each floor. In each iteration, the loop should ask the user for the number of rooms on the floor and how many of them are occupied. After all the iterations, the program should display how many rooms the hotel has, how many of them are occupied, howmany are unoccupied, and the percentage of rooms that are occupied. The percentage may be calculated by dividing the number of rooms occupied by the number of rooms. Run your program twice with the following data: Run 1 Floors on the hotel: 5Rooms on floor 1: 10Rooms occupied: 5Rooms on floor 2: 12Rooms occupied: 11Rooms on floor 3: 8Rooms occupied: 4Rooms on floor 4: 10Rooms occupied: 0Rooms on floor 5: 12Rooms occupied: 8 Run 2Floors on the hotel: 6Rooms…arrow_forward
- MPI Lab Directions Write an MPI program, countprimes which will count the number of prime numbers in the numbers from 1 to n inclusive where n is a long integer. The value for n which should be set in the program using a constant should be 50,000. Each process will test its share of the cases. Each process should not print out any primes that it finds, but it should keep a running total. Before the process finishes, it should print out its ID number and its count of primes that it found. The master process should end with printing a total for the count of the number of primes and the total amount of time taken to find all the primes. Take a screenshot of the output for running this with 5 processes. Before submission, make sure you clean up the directories so that no miscellaneous files are kept around in the submission. (Grade would be deducted if useless files are found in the homework directories.) Include the source code, screenshot, and the Makefile in the submission. Your…arrow_forwardTranscribed Image Text Create a program that allows the user to do some basic functions. First, ask the user if they would like to find out sqrt, log or factorial of a number, then return the results. Here is the sample output: Welcome to the simple math helper. What would you like to calculate? 1. Sqrt 2. Log 3. Factorial > 1 Enter the number to sqrt: >9arrow_forwardLab 6: Multiplication Table Write a program that will continually ask the user to enter a positive number from standard input and print out the multiplication number table until user enters an alphabet (non number) to quit. Once user enters 'Q' or anything other than a number, the program will print out “Have a nice day" and then exit the program. After reading the user's input the positive number, the program will print out the multiplication table of the inputted number. For example, if user enters 5, the table should be: Multiplication table for 5 is: 2 3 4 5 4 6 8 10 9 12 15 8 12 16 20 5 10 15 20 25 Your program needs continuously ask the user to enter the a positive number until the user enters Q or q to exit the program. Your program must print out your names and lab info as you did in previous lab similar to the following: Program written by: Ron Sha Course info: Cs-102 Lab 6 - Multiplication Table Date: Wed Oct 14 11:35:18 2020 Activate un 1.2345arrow_forward
- Part A: While Loop ProgramWrite a program that detects Fibonacci numbers. Prompt the user to input a positive integer. Upon input, the program will determine if the number is either a Fibonacci number or not. If a Fibonacci number, then the order of the number in the sequence must be output. If not a Fibonacci number, then the Fibonacci numbers above and below it (including their order in the sequence) must be output. Once it finishes, the program will prompt the user for a new number. The program will exit if the user enters a non-integer number or string (such as “quit”) instead of an integer. Use the sample output file, fib-seq-det.txt, to view a sample session For both the above problems, the first four numbers of the Fibonacci sequence are 0, 1, 1, and 2. Part A must use While loops only. Invalid (negative) numbers should be flagged and handled. Output should be like: Welcome to the Fibonacci Sequence Detector Please input a number for analysis >> 00 is a…arrow_forwardPython Programming Create a program that allows user to enter student names and scores, the program is to also allow defining the subject the grades are being entered for. The entered information is to be stored in a DataFrame. First, the program is to ask user how many tests are the grades for. If 3 entered for instance, the program is to ask user to enter test names. Next, the program is to ask the user the number of students they would like to enter grades for. Then the program is to ask user to enter dictionary information as following: Student Name List of grades (3 grades minimum) An example of the outcome is shown in the following picture:arrow_forwardChapter 4 Loops and Files 17. Random Number Guessing Game Write a program that generates a random number and asks the user to guess what the num- ber is. If the user's guess is higher than the random number, the program should display "Too high, try again." If the user's guess is lower than the random number, the program should display "Too low, try again." The program should use a loop that repeats until the user cor rectly guesses the random number.arrow_forward
- Programming language C#arrow_forwardPROGRAMMING PROBLEM The inventory of a shoe store lists shoes by stock number. With each stock number, there is associated a style number in the range of 0 to 50, the number of pairs in each size (sizes range from 3 to 14) and a price. A program is to be written to keep track of the inventory. The user is given the following choices: enter a new record, display a record, change the price of the stock item, or change the number on hand. When specifying a record the user may give either the stock number, or the style number. The array index can be used as a stock number. If the user decides to change the stock on hand, the program should ask which sizes will have their stock on hand changed. The program should be designed to run indefinitely, keeping track of changed in stock.arrow_forwardCelsius to Fahrenheit TableWrite a program that displays a table of the Celsius temperatures 0 through 20 and their Fahrenheit equivalents. The formula for converting a temperature from Celsius to Fahrenheit isF=9/5C+32where F is the Fahrenheit temperature, and C is the Celsius temperature. Your program must use a loop to display the table.arrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT