C++ How to Program (10th Edition)
10th Edition
ISBN: 9780134448237
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Please answer this and plz do not reject it under complex question.thank u.
Python question
Question 18 (Basic problem)
A list of tuples named cereal_data contains calorie and price details of different cereals. Each tuple contains three elements. The first element of each tuple is the cereal name, stored as a string. The second element is the calorie content and the third element is the price per 100g. The calorie content and the prices are stored as floats.
Write a function chosen_cereals(cereal_data,dollar_amount,cal_amount), which returns a list of cereal names which costs less than the dollar_amount and contains less calories than cal_amount. Your function should return None if no records are available that meet the given criteria. See the examples given below (doctests).
Note: Your function should work with any database given.
def chosen_cereals(cereal_data,dollar_amount,cal_amount): """ Input: A list of tuples with the cereal name, calorie content and the price per 100g. Output: A list of cereal names that costs less than the…
1. [LO 1, LO 2, LO 3 & LO 4, Treasure Hunter Description
You are in front of a cave that has treasures. The cave can be represented in a grid which has rows numbered from 1 to , and columns numbered from 1 to . For this problem, define (x,y ) as a tile that is in the the-x row and the y-row. There is a character in each tile, which indicates the type of that tile. Tiles can be floors, walls, or treasures which are represented respectively by the characters '.' (period), '#' (hashmark), and '*' (asterisk). You can go through the floor tiles and treasures, but you can't get past the wall tiles.Initially, you are in a tile (??, Sy). You want to visit all the treasure squares, and retrieve the treasure. When you visit a treasure tile, the treasure is instantly retrieved, and the tile turns into a floor.In a move, if you are on a tile (?,y), then you can move to the right tile above (?-1,y), right (?,y + 1), down (? + 1, ), and left (?, 1) of the current tile. The tile you visit must…
Chapter 14 Solutions
C++ How to Program (10th Edition)
Ch. 14 - (Fill in the Blanks) Fill in the blanks in each of...Ch. 14 - (File Matching) Exercise 14.3 asked you to write a...Ch. 14 - (File Matching Test Data) After writing the...Ch. 14 - Prob. 14.8ECh. 14 - (File-Matching Enhancement) Its common to have...Ch. 14 - Write a series of statements that accomplish each...Ch. 14 - Prob. 14.11ECh. 14 - (Telephone-Number Word Generator) Standard...Ch. 14 - (sizeof Operator) Write a program that uses the...Ch. 14 - Prob. 14.14MAD
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
- HCI is (Human Computer Interaction) Answer the following five statements by first stating whether it is true or false and then given one sentence for justifying your answer a) You drag a folder to make a copy of its contents. An animation appears on the screen, showing files moving from one folder to another. This is an example of feedback. b) In augmented reality a screen is composed of a computer animation of the reality. c) The Model Human Processor is used in HCI to model complex cognitive processes d) Petri Nets can be helpful in modeling concurrent activities in a user interface. e) Gestalt is important to HCI as it offers tools to understand scenes.arrow_forwardProblem B. Musical Key ConversionThe chromatic scale is a 12-note scale in music in which all notes are evenly spaced: that is, the ratio of the frequency between any two consecutive notes is constant. The notes are typically labeled in the following sequence: A, A#, B, C, C#, D, D#, E, F, F#, G, G# After G#, the labels loop back and start over with A (one octave higher). To convert between musical keys, you can shift all notes in a piece of music a constant number of steps along the scale above. For example, the sequence of notes E, E, F, G, G, F, E, D, C, C, D, E, E, D, D can be converted to another musical key by shifting everything up three steps: E, E, F, G, G, F, E, D, C, C, D, E, E, D, D G, G, G#, A#, A#, G#, G, F, D#, D#, F, G, G, F, F Notice that G was converted to A#, since going three steps up required us to loop off of the top of the scale back to the bottom: G -> G# -> A -> A#. Technically we should note that this would be A# of the next octave up, but we’ll…arrow_forward4arrow_forward
- MG 20 (create a specified custom function) My Soluti Create a Function - [Problem written by Ryan] A person works out 4 days over the course of a week and is trying to calculate their range of steps for days they work out versus the days they do not. They decided to analyze the data by using the number of steps each day that their watch collected over a two week span, Instead of assigning each day as a workout day or a nonworkout day, they decide to just assume workout days are any day that their step count is above the median step count for the two week span. Write a function that analyzes her steps (in thousands) in vector s (already created in given code). This function should categorize their steps into separate arrays for workout and non-workout days. It should then output the range for workout days as a 1x2 array named Max Step Range and output the range for non-workout days as a 1x2 array named Min_Step Range. These arrays should posess the minimum value in the first column and…arrow_forwardAlert dont submit AI generated answer. Python please solve all question.arrow_forwardWindow Help Questions.pdf (page 4 of 6) Q Search Question 3 Complete the header, write one example and the body of the function according to the description def q3(d1: Dict[str, int], d2: Dict[str, int]) -> : "'Modify d1 by updating the values for each key in d1 that is also a key in d2. For such keys, the old value should be subtracted by the value of the same key in d2. If the new value of a key becomes smaller than 0, set the new value to zero.arrow_forward
- Discrete Matharrow_forward(ms excel In Moray, employees have Wednesdays and Thursdays off, and the following holidays: January 1, February 12, April 5, May 4, July 21, October 10-12, December 24-26. Design a spreadsheet in which the user can enter start and end dates, and the worksheet returns the total number of working days? Your spreadsheet should work for end dates entered up to and including December 31, 2030. Use formulas to generate the dates of the holidays. The result should be blank if no dates are entered.arrow_forward1)Create a function that takes Celsius temperature and returns a Fahrenheit. Study CURSOR with parameters chapter, and Cursor For Loop. Use a cursor FOR loop inside your procedure.arrow_forward
- ( Please note that 1000 to 1500 words are mandatory or the answer will be rejected)Please include an introduction and a body and a conclusion for the below question, kindly note that it is mandatory to have a word count of 1000 to 1500 words at least and that the answer should be plagiarism free, please. Question 1- Discuss the use of artificial intelligence, machine learning, and deep learning, as well as their importance in the digital economy. (Use examples and include academic references)arrow_forward(d) Using the IF function, write a formula in J6 to display "Yes" if the activity is critical and display "No" if the activity is not critical. Copy the formula to cells J7:J14. Screen shot attached thanksarrow_forwardQ1) Write a C code that outputs in the form of square matrices given as an example below according to the number of "N" entered. (“N" value presents size of (N x N) square matrix.) The only input should be the number "N" and output in the required order. Note: Be careful when the "N" value is even and odd. Please enter size of table 5 1 2 3 2 1 2 3 4 3 2 3 4 5 4 3 4 5 6 5 4 5 6 7 6 5 Process exited after 2.525 seconds with return value e Press any key to continue . Please enter size of table 4 1 2 2 1 2 3 3 2 3 4 4 3 4 5 5 4 Process exited after 1.206 seconds with return value e Press any key to continuearrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Algebraic Expressions – Algebra Basics; Author: TabletClass Math;https://www.youtube.com/watch?v=U-7nq7OG18s;License: Standard YouTube License, CC-BY
Python Tutorial for Beginners 3 - Basic Math, Mathematical Operators and Python Expressions; Author: ProgrammingKnowledge;https://www.youtube.com/watch?v=Os4gZUI1ZlM;License: Standard Youtube License