Computer Science: A Structured Programming Approach Using C, Third Edition
3rd Edition
ISBN: 9780534491321
Author: Behrouz A. Forouzan, Richard F. Gilberg
Publisher: Course Technology, Inc.
expand_more
expand_more
format_list_bulleted
Question
Chapter 6, Problem 36PS
Program Plan Intro
Program Plan:
- Include all necessary header files.
- Declare the main () function.
- Declare listSize, largestValue, lVCount, listIntegers, and i variables used in the program.
- Prompt the user to enter the number of elements and the elements itself.
- Use for and if loops to find the largest value and the occurrences of it.
- Display the final results.
Program Description: The main purpose of the program is to determine the largest value from the list of integers entered by the user and the number of times the largest value is entered.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Python
The GCD (Greatest Common Divisor) of two numbers is the largest positive integer number
that divides both the numbers without leaving any remainder. Write a program that prompts
the user to enter two positive integers and computes their GCD. For example. GCD of 30 and
45 is 15.
Sample Run 1:
Enter two integers: 30 45
GCD of 30 and 45 is 15
Sample Run 2:
Enter two integers: 55 121
GCD of 55 and 121 is 11
1.
Write a program that lets the user
guess whether a randomly generated integer
would be even or odd.
The program randomly generates an
integer and divides it by 2. The integer is even
if the remainder is 0, otherwise odd. The
program prompts the user to enter a guess and
reports whether the guess is correct or
incorrect.
Chapter 6 Solutions
Computer Science: A Structured Programming Approach Using C, Third Edition
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Java programarrow_forwardjava programarrow_forwardQ1: Write a program that reads a set of N integers. Then, the program finds and outputs the sum of the even values and the sum of the odd values of them. For example: if the value entered for N=5, and the five integers are 3, 6, 2, 9, 7. Then the sum of even values (6+2 = 8), and the sum of odd values (3+9+7 = 19) Q2: Write a program that reads some numbers until it reaches a specific value (assume -1 is a stop value in this case). The program should find and outputs the average of all of the numbers (between 10...40) except the stop value (-1). For example: If the numbers look like: 12 5 30 48 -1. Then, the average of the numbers: (12+30)/2 = 21.arrow_forward
- Three numbersa. Write a program that reads three numbers and prints “all the same” if they are allthe same, “all different” if they are all different, and “neither” otherwise.b. Write a program that reads three numbers and prints “increasing” if they are inincreasing order, “decreasing” if they are in decreasing order, and “neither”otherwise. Here, “increasing” means “strictly increasing”, with each value largerthan its predecessor. The sequence 3 4 4 would not be considered increasing.c. Repeat part b. but before reading the numbers, ask the user whetherincreasing/decreasing should be “strict” or “lenient”. In lenient mode, thesequence 3 4 4 is increasing and the sequence 4 4 4 is both increasing anddecreasingarrow_forwardThis example creates a program to teach a first grade child how to learn subtractions. The program randomly generates two single- digit integers number1 and number2 with number1 > number2 and displays a question such as "What is 9 – 2?" to the student. After the student types the answer, the program displays a message to indicate whether the answer is correct.arrow_forwardJavaarrow_forward
- Coin Exchange: Write a program that will determine how many coins of each denomination (50kr, 25kr, 10kr, Skr, and 1kr) are required to make up a given amount of change. For example, to make 57kr we could use 1 x 50kr, 1 x 5kr, and 2 x 1kr., It should be obvious that many combinations of coins are possible. For example, in the example above, we could make up 57kr with: (57 x 1kr) or (2 x 25kr and 7 x 1kr). However, your program must use the smallest number of coins (10 points). Example program output: Enter amount: 40 40 Kr = 1 x 25Kr 1х 10Кr 1 x 5Krarrow_forwardLanguage :Python write a program that asks the user to enter a series of single digit numbers with nothing seperating them. The program should display the sum of all the single digit numbers in the string. For example, if the user enters 2514 the method should return 12, which is hw sum of 2,5,1 and 4. write a program that reads a string from the user containing a date in the form mm/dd/yy. it should print the date in the format March 12, 2018.arrow_forwardA palindromic number is a number that is the same when written forwards or backwards. The first few palindromic numbers are therefore are: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, 44, 55, 66, 77, 88, 99, 101, 111, 121, 323 Input a number from the user. Write a program that reverses the digits of a number. Use this program to find if the number is a palindrome. Print if the number is palindrome or not.arrow_forward
- computer programingarrow_forwardPart 1: Complete the survey. Part 2: Peek-a-boo is a fun game that little kids like to play. To simulate this game on the computer, write a program that will generate a random number between 1 and 4. Then, will print to the screen the animal name associated to that number. The animal names used will be: pig when a 1 is generated cow when a 2 is generated chicken when a 3 is generated horse when a 4 is generated If your program generates a 3, the output will be: chicken The player will then enter a 1 if they would like to play again or anything else to exit the program. If the player enters "1 1 1 0", the output will be: horse chicken cow horse For coding simplicity, follow each output animal by a space, even the last one. Hint: To make testing easier, seed your random number generator with 0.arrow_forwardSlove by pythonarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Introduction to Big O Notation and Time Complexity (Data Structures & Algorithms #7); Author: CS Dojo;https://www.youtube.com/watch?v=D6xkbGLQesk;License: Standard YouTube License, CC-BY