![Programming in C](https://www.bartleby.com/isbn_cover_images/9780321776419/9780321776419_largeCoverImage.gif)
Concept explainers
Type in and run the eight programs presented in this chapter. Compare the output produced by each
![Check Mark](/static/check-mark.png)
Explanation of Solution
Program 6.1:
Purpose of the program:
- The purpose of the program is to illustrate the function of arrays.
- The program contains an array that is initialized with certain values. By using “for” loop, the values of array are printed on the screen.
values[0] = 197
values[1] = -2
values[2] = -101
values[3] = 547
values[4] = 4200224
values[5] = 350
values[6] = 4200326
values[7] = 4200224
values[8] = 8600872
values[9] = 35
Comparison:
The program “6.1” runs successfully and produces the output as it is given in the text book.
Want to see more full solutions like this?
Chapter 6 Solutions
Programming in C
Additional Engineering Textbook Solutions
Starting Out with Python (4th Edition)
C Programming Language
Starting Out with Programming Logic and Design (4th Edition)
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
Concepts of Programming Languages (11th Edition)
Digital Fundamentals (11th Edition)
- please code in python question in imagearrow_forwardSection: Algorithm 7. s] A transport consultant has created a file of information about trips collected from individuals who have participated in a survey. This information includes start_time and end_time variables. One of the items contained in the file is the duration of each trip (that is, end_time – start_time) in minutes. The consultant is trying to work out how to calculate the number of trips with duration greater than 60 minutes (that is, how many trips take longer than an hour) and requires your assistance to develop an algorithm. You can assume that the durations are read one at a time and should only be read until EOF (end of file) is reached. i. ] *Develop a flowchart to show your algorithm, using the diagrammatic conventions described in the lecture. s] What is the likely complexity of your program using big-O notation? ** 11. Clearly point out what the primary parameters are and define your terms.arrow_forwardComputer Science Using matplot write a python program to show plotter with the covid-19 affected people and not affected people with list of values given in program.[Hint: make two different color to differentiate the label] Write a python program to implement linear regression and show the plottingsarrow_forward
- 2. Using MATLAB or OCTAVE to,a) Find the values a, b and c of the upward velocity of rocket approximated by polynomial as SEE PHOTO ----------- Where velocity of the rocket is given at three different times on the following table.arrow_forwardConvert the octal NUMBER 1600. 5216 to hexadecimal number showing the steps (Note : The problem should be solved in separate paper with steps and scanned copy should be submitted along with other answers Final answer must be entered in the boxes provided below. For Hexadecimal digits from A to F, enter their equivalent decimal value in the corresponding box; do not enter the letter (For eg- for A, write 10, for B write 11 etc); Enter only one digit in each box. If there is any unused box, fill it with 0 -do not leave it blank) In the written submission, use the letters A to F for hex digits instead of the values) Integer part = Fractional part =arrow_forwardWrite a Matlab function that calculates the series summation S =EE: %3D for a given n and m. Write the Name of the m file top of the box and your Matlab code inside the box belowarrow_forward
- (Heat transfer) The formula developed in Exercise 5 can be used to determine the cooling time, t, caused only by radiation, of each planet in the solar system. For convenience, this formula is repeated here (see Exercise 5 for a definition of each symbol): t=Nk2eAT3fin A=surfaceareaofasphere=4r2 N=numberofatoms=volumeofthespherevolumeofanatom Volume of a sphere sphere=43radius3 The volume of a single atom is approximately 11029m3 . Using this information and the current temperatures and radii listed in the following chart, determine the time it took each planet to cool to its current temperature, caused only by radiation.arrow_forwardMATLAbarrow_forwardQuestion-1 Friend's Party Circle: There are a few friends living in the same area. They have a party every weekend and the place of party change each week. It is always a difficult task to select a place which is nearest for everyone. They all decided advantage of Computer Science to solve this problem. to take Names of friends are Ahmed, Rehman, Careem, Basit, Dawood, Ghani, and Farid. Ahmed lives at 5 minutes’walk from rehman and at 10 minutes' walk from Careem. Careem lives at 3 minutes' walk from Dawood. Rehman lives at 4 minutes' walk from Basit and 2 minutes' walk from Dawood. Dawood lives at two minutes' walk from Farid. Ghani lives at 2 minutes' walk from Basit. b. In above directed graph G. You are required to devise an algorithm to find all possible paths.arrow_forward
- Algorithms and data examples to be written: Problem 1: (Hint: Use a sequential structure) How do you calculate the miles you are getting per gallon of gasoline if you record the mileage readings from your car's odometer each time you fill up the gas tank? Two odometer readings should be inputted, one reading is before you fill up the gas tank, and the second reading is when you refill the gas tank. The third input is the quantity of gallons of gasoline purchased when the gas tank is refilled. After inputting these 3 values, calculate and output: The miles traveled between gas refills The average miles per gallon based on the miles traveled and the amount of gasoline purchased after the time the gas tank is refilled a. b. Algorithm: Data Example: Problem 2: (Hint: Use a sequential structure) How do you calculate the price you would pay for an item if it is on sale and you have an additional discount coupon? To calculate the final price paid, 3 inputs are needed: the original price of…arrow_forwardSum of Numbers Find the sum of the first one hundred positive integers. See Fig. 3.51. Schneider, David I.. Introduction to Programming Using Python, An (2-downloads) (p. 131). Pearson Education. Kindle Edition.arrow_forwardDigital lab & design The circuits don’t have to be created in proteus project just a normal drawing on paper will do, thanks. 1)arrow_forward
- 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
![Text book image](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)
![Text book image](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)