C How to Program (8th Edition)
8th Edition
ISBN: 9780133976892
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 4, Problem 4.23E
(Calculating the Compound Interest with Integers)Modify the
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Q29) Consider you have a list of 20 exam scores. Write a computer
program that calculates the average of the top 8 scores. The program
prints the message "The average top eight scores is:" and then prints
the average number. Exam scores: 73, 91, 37, 81, 63, 66, 50, 90, 75,
43, 88, 80, 79, 69, 26, 82, 89, 99, 71, 59
Q2) Write a program to read a
group of numbers between 1 to
100, then find the sum of the even
numbers that are divisible by 4
and the sum of the odd numbers
that are divisible by 3 using do
while
(Python matplotlib or seaborn)
CPU Usage
We have the hourly average CPU usage for a worker's computer over the course of a week. Each row of data represents a day of the week starting with Monday. Each column of data is an hour in the day starting with 0 being midnight.
Create a chart that shows the CPU usage over the week. You should be able to answer the following questions using the chart:
When does the worker typically take lunch?
Did the worker do work on the weekend?
On which weekday did the worker start working on their computer at the latest hour?
cpu_usage = [
[2, 2, 4, 2, 4, 1, 1, 4, 4, 12, 22, 23,
45, 9, 33, 56, 23, 40, 21, 6, 6, 2, 2, 3], # Monday
[1, 2, 3, 2, 3, 2, 3, 2, 7, 22, 45, 44,
33, 9, 23, 19, 33, 56, 12, 2, 3, 1, 2, 2], # Tuesday
[2, 3, 1, 2, 4, 4, 2, 2, 1, 2, 5, 31,
54, 7, 6, 34, 68, 34, 49, 6, 6, 2, 2, 3], # Wednesday
[1, 2, 3, 2, 4, 1, 2, 4, 1, 17, 24, 18,
41, 3, 44, 42, 12, 36, 41, 2, 2, 4, 2, 4], # Thursday
[4, 1, 2, 2, 3, 2, 5, 1, 2, 12, 33, 27,
43, 8,…
Chapter 4 Solutions
C How to Program (8th Edition)
Ch. 4 - Find the error in each of the following. (Note:...Ch. 4 - State which values of the control variable x are...Ch. 4 - Write for statements that print the following...Ch. 4 - Prob. 4.8ECh. 4 - (Sum a Sequence of Integers) Write a program that...Ch. 4 - (Average a Sequence of Integers) Write a program...Ch. 4 - (Find the Smallest) Write a program that finds the...Ch. 4 - (Calculating the Sum of Even Integers) Write a...Ch. 4 - (Calculating the Product of Odd Integers) Write a...Ch. 4 - (Factorials) The factorial function is used...
Ch. 4 - (Modified Compound-Interest Program) Modify the...Ch. 4 - (Triangle-Printing Program) Write a program that...Ch. 4 - (Calculating Credit Limits) Collecting money...Ch. 4 - (Bar-Chart Printing Program) One interesting...Ch. 4 - (Calculating Sales)An online retailer sells five...Ch. 4 - (Truth Tables) Complete the following truth tables...Ch. 4 - Rewrite the program of Fig. 4.2 so that the...Ch. 4 - Prob. 4.22ECh. 4 - (Calculating the Compound Interest with...Ch. 4 - Assume i=1,j=2,k=3andm=2. What does each of the...Ch. 4 - (Table of Decimal, Binary, Octal and Hexadecimal...Ch. 4 - (Calculating the Value of )Calculate the value of...Ch. 4 - Prob. 4.27ECh. 4 - (Calculating Weekly Pay)A company pays its...Ch. 4 - (De Morgans Laws)In this chapter, we discussed the...Ch. 4 - (Replacing switch with if ... else)Rewrite the...Ch. 4 - (Diamond-Printing Program)Write a program that...Ch. 4 - (Modified Diamond-Printing Program)Modify the...Ch. 4 - (Roman-Numeral Equivalent of Decimal Values)Write...Ch. 4 - Describe the process you would use to replace a do...Ch. 4 - A criticism of the break statement and the...Ch. 4 - Prob. 4.36ECh. 4 - Describe in general how you would remove any...Ch. 4 - (The Twelve Days of Christmas Song) Write a...Ch. 4 - (Limitations of Floating-Point Numbers for...Ch. 4 - (World Population Growth) World population has...Ch. 4 - (Tax Plan Alternatives; The FairTax) There are...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
True or false? a.An abstract class can be used just like a nonabstract class except that you cannot use the new...
Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
Why is the study of database technology important?
Database Concepts (8th Edition)
Create variable names that would be appropriate for holding each of the following information items: a. The num...
Starting Out With Visual Basic (8th Edition)
Private Sub Handles btnOutput.Click
End Sub
Introduction To Programming Using Visual Basic (11th Edition)
Define a class called Counter. An object of this class is used to count things, so it records a count that is a...
Java: An Introduction to Problem Solving and Programming (7th Edition)
Self-Test Exercise 17 asked you to overload the operator and the operator for a class Pairs. Complete and tes...
Problem Solving with C++ (10th 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
- Q2) Write a program to read a group of numbers between 1 to 100, then find the sum of the even numbers that are divisible by 4 and the sum of the odd numbers that are divisible by 3.arrow_forward1. Countthe number of per character in a given sentence/paragraph. (“Hello World!” H-1,e-1, l-3, o-2…)2. Checkif the input contains characters that are not part of the alphabet. (“a#no”;“#” not part of alphabet)3. Replaceall characters in the paragraph with numbers corresponding to their alphabetnumber. (“Abe” – 125; “bad” – 214)USE JAVA PROGRAMMINGarrow_forward2. C program to draw pyramid with *. Ex – height 4: *** ***** ******* Hint: According to bottom line, find the number of blank characters at the first line(how many blank is at right side and how many blank is at left side?). If height of pyramid is 4, then bottom line has got 7 asterix ((4-1)*2+1). First line has got 6 blank (4-1 left side and 4-1 right side) characters and one Asterix (at the middle.arrow_forward
- PYTHON (Uee While Loop) only Write a python program that calculates the populations of foxes and rabbits who live within a certain area of land, as that number changes from year to year. It will take the initial populations as inputs, and then proceed to calculate the year-by-year changes. The following is derived from the “Lotka-Volterra equations”, which you may look up if you desire. Essentially, we will model the foxes and rabbits with 4 constants, and 2 data structures of year-by-year values. They are defined as follows: r[y] # of rabbits in year y f[y] # of foxes in year y α or alpha - birth rate of rabbits β or beta - death rate of rabbits, dependent on # of foxes γ or gamma - birth rate of foxes, dependent on # of rabbits δ or delta - death rate of foxes, caused naturally The formulas we will use are: r[y]=r[y−1]+(r[y−1]×α)−(r[y−1]×f[y−1]×β)r[y]=r[y−1]+(r[y−1]×α)−(r[y−1]×f[y−1]×β) f[y]=f[y−1]+(f[y−1]×r[y−1]×γ)−(f[y−1]×δ)f[y]=f[y−1]+(f[y−1]×r[y−1]×γ)−(f[y−1]×δ) However,…arrow_forwardC Program In order to discourage excess electric consumption, an electrical company charges its customers a lower rate of P75 for the first 250 kilowatt-hours and a higher rate of P8.5 for each additional kilowatt-hour. In addition, a 10% surtax is added to the final bill. Write a program that calculates the electrical bill given the number of kilowatt-hours consumed as input. At the end, print the number of kilowatt-hours consumed and the computed bill.arrow_forwardProblem 3 Rolling Two Dice Write a program that simulates the rolling of two dice. The program should use rand twice to roll the first die and second die, respectively. The sum of the two values should then be calculated. [Note: Because each die can show an integer value from 1 to 6, then the sum of the two values will vary from 2 to 12, with 7 being the most frequent sum and 2 and 12 the least frequent sums.] Figure 6.24 shows the 36 possible combinations of the two dice. Your program should roll the two dice 36,000 times. Use a one-dimensional array to tally the numbers of times each possible sum appears. Print the results in a tabular format. Also, determine if the totals are reasonable; i.e., there are six ways to roll a 7, so approximately one-sixth of all the rolls should be 7.arrow_forward
- Q5: Write in Python program: After calculating the ranking score according to the ALES (Academic Postgraduate Exam) score, foreign language score and graduation grade point average of the candidate applying for graduate education, write the program in python, which will be able to enter the ranking on the screen. (All points are given over a hundred.) Ranking Score = 50% of ALES + 25% of foreign language score + 25% of graduation grade point average It is calculated by the formula. If the ranking score is 60 and above, it can enter the ranking, otherwise it cannot. Example: Enter ALES score: 80.91 Enter the foreign language score: 80.50 Graduation GPA: 75.56 ------------------------- Your ranking score: 79.47arrow_forward5) Write a program that reads three numbers and prints "increasing" if they are in increasing order, "decreasing" if they are in decreasing order, and "neither" otherwise. Here, "increasing" means "strictly increasing", where each value is less than the next. The sequence 3 4 4 would not be considered increasing, for example. 6) Repeat Exercise 5, but first ask the user whether "increasing/decreasing" should be "strict" or "lenient". In lenient mode, the sequence 3 4 4 is "increasing", and the sequence 4 44 is both increasing and decreasing.arrow_forwardExams.cpp) Suppose a teacher weights the fourexams he gives 10%, 25%, 30%, and 35%. Write a programthat reads ten sets of four grades, prints the weightedaverage of each set, and prints the unweighted average ofeach test. The number of students should be in a globalconstant.arrow_forward
- Q1) Programming in C Research our planet population growing issues online. Get approximations for the current population and its growing rate (the percentage by which it’s likely to increase this year). Write a program in C language that calculates a)World population growth each year for the next 25 years, using the supposition that the current growth rate will remain unchanged. b)Print the results in a table. The first column should display the year from year 1 to yearThe second column should display the anticipated world population at the end of that year.The third column should display the numerical increase in the world population that would occurthat year.arrow_forwardMATLAB QUESTION - As of 2018, the population of "A city" is 646 thousand and the population of "B city" is 269 thousand. While the population of "A city" decreases by 7.1% every year, the population of "B city" increases by 12.9%. According to this information, write a program that calculates the year in which the population of "B city" passed the population of "A city".arrow_forwardQ2) Write a program that reads a one-line sentence as input and then displays the following response: If the sentence ends with a question mark (?) and the input contains an even number of characters, display the word "Yes". If the sentence ends with a question mark and the input contains an odd number of characters, display the word "No". If the sentence ends with an exclamation point (!), display the word "Wow". In all other cases, display the words " you always say "followed by the input string enclosed in quotes" ". Your output should all be on one line. Be sure to note that in the last case, your output must include quotation marks around the echoed input string. In all other cases, there are no quotes in the output. Your program does not have to check the input to see that the user has entered a legitimate sentence. Sample Input#1: Please enter a one line question or statement. How are you? Sample Output#1: Yes Sample Input #2: Please enter a one line…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Introduction to Operators in C; Author: Neso Academy;https://www.youtube.com/watch?v=50Pb27JoUrw;License: Standard YouTube License, CC-BY