C++ for Engineers and Scientists
4th Edition
ISBN: 9781133187844
Author: Bronson, Gary J.
Publisher: Course Technology Ptr
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 7.1, Problem 2E
(Practice) Write correct notation for the first, third, and seventh elements of the following arrays:
a. int grades[20]
b. double volts[10]
c. double amps[16]
d. int dist[15]
e. double velocity[25]
f. double time[100]
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
(Element-Wise array Multiplication) Create a 3-by-3 array containing the even integers from 2 through 18. Create a second 3-by-3 array containing the integers from 9 down to 1, then multiply the first array by the second. Using Python. Please keep it simple.
(C PROGRAMMING ONLY)
1. Spell-it-out!by CodeChum Admin
Are you intimidated with complicated words? Don't be! The trick is to break it down letter by letter!
Let’s create a program that prints out the character in the array index indicated by the input integer. For example, if the array has 3 character elements, 'j', 'r', and 'd', and the inputted integer value is 1, then we print 'r' because 'r' is found at index 1.
Instructions:
In the code editor, you are provided with an array of characters (or a string).Your task is to ask the user for an integer input which represents the index and then print out the character of the string found at that index.Input
1. Index of the array
Output
Enter the index: 4r
(C PROGRAMMING ONLY)
3. Starting My Businessby CodeChum Admin
I want to be an entrepreneur! But I don't have capital, could you help me find one? Hihi
Instructions:
Ask the user for an array of characters/string. For this program, it is guaranteed that the input of the user has one and only one capital character.Your task is to search for that one capital character and then print it and its index.Input
1. Inputted string
Output
Enter a string: jejuMarCapital M found at index 4
Chapter 7 Solutions
C++ for Engineers and Scientists
Ch. 7.1 - (Practice) Write array declarations for the...Ch. 7.1 - (Practice) Write correct notation for the first,...Ch. 7.1 - Prob. 3ECh. 7.1 - (Practice) a. Write output statements using cout...Ch. 7.1 - (Desk check) List the elements displayed by the...Ch. 7.1 - (Practice) a. Write a program to input the...Ch. 7.1 - (Practice) Write a program to input eight integer...Ch. 7.1 - (Data processing) a. Write a program to input 10...Ch. 7.1 - Prob. 9ECh. 7.1 - (Electrical eng.) Write a program that specifies...
Ch. 7.2 - (Practice) Write array declarations, including...Ch. 7.2 - (Data processing) Write an array declaration...Ch. 7.2 - (Data processing) Write a program that uses an...Ch. 7.2 - (Electrical eng.) Write a program that stores the...Ch. 7.2 - (Practice) a. Write a declaration to store the...Ch. 7.3 - (Practice) Write specification statements for the...Ch. 7.3 - (Desk check) Determine the output produced by the...Ch. 7.3 - (Practice) a. Write a C++ program that adds the...Ch. 7.3 - (Practice) Write a C++ program that adds...Ch. 7.3 - Prob. 5ECh. 7.3 - (Electrical eng.) a. An engineer has constructed a...Ch. 7.4 - Prob. 1ECh. 7.4 - Prob. 2ECh. 7.4 - Prob. 3ECh. 7.4 - Prob. 4ECh. 7.4 - Prob. 5ECh. 7.4 - (Electrical eng.) Write a program that declares...Ch. 7.4 - (Statistics) Write a program that includes two...Ch. 7.5 - Prob. 1ECh. 7.5 - (Practice) Run Program 7.10 to determine the...Ch. 7.5 - Prob. 3ECh. 7.5 - (List maintenance) a. Write a complete C++ program...Ch. 7.5 - Prob. 5ECh. 7.5 - (List maintenance) The following letters are...Ch. 7.5 - (File creation) Write a C++ program that creates...Ch. 7.5 - Prob. 8ECh. 7.5 - Prob. 9ECh. 7.5 - Prob. 10ECh. 7.5 - Prob. 11ECh. 7.5 - Prob. 12ECh. 7.5 - Prob. 13ECh. 7.5 - Prob. 14ECh. 7.5 - Prob. 15ECh. 7.6 - Prob. 1ECh. 7.6 - Prob. 2ECh. 7.6 - Prob. 3ECh. 7.6 - Prob. 4ECh. 7.6 - Prob. 5ECh. 7.6 - Prob. 6ECh. 7.6 - Prob. 7ECh. 7.6 - Prob. 8ECh. 7.6 - (Practice) Use the max_element and min_element...Ch. 7 - (Statistics) a. Write a C++ program that reads a...Ch. 7 - (Practice) Define an array named peopleTypes that...Ch. 7 - (Numerical) Given a one-dimensional array of...Ch. 7 - (Numerical) Write and test a function that returns...Ch. 7 - (Sorting) Read a set of numerical grades from the...Ch. 7 - (Numerical) a. Define an array with a maximum of...Ch. 7 - (Numerical) Using the srand() and rand() C++...Ch. 7 - (Statistical) In many statistical analysis...Ch. 7 - (Data processing) Your professor has asked you to...Ch. 7 - (Modify) Modify the program written for Exercise 9...Ch. 7 - Prob. 11PPCh. 7 - (Data processing) The answers to a true-false test...Ch. 7 - Prob. 13PPCh. 7 - (Data processing) Construct a three-dimensional...Ch. 7 - (Computation) A magic square is a square of...Ch. 7 - (Computation) Among other applications, Pascal’s...
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
- Don't try to copy other's work. I need correct response without plagiarism. Don't attempt if you are not sure about this. I'll give you downvotes for plagiarism and wrong answer.arrow_forward[C Program] 2. Cubes and Squares by CodeChum Admin You can also make a list of numbers, ey? Let's go and have some fun in tweaking the values of each element, but let's give it some twist to add on some fun to the code. Let's have a go at it! Instructions: An array containing 40 integer elements is already provided for you in the code editor below. Using loops and conditions, print out the cube of the array element if it is a positive number, and print out the square of the number if it is negative. Each result must be printed out separately by each line. Output The squares and cubes of the elements in the array. 4 1 1 8 27 . . . ------------ #include<stdio.h> int main(void) { int nums[40] = { -2, 1, 1, 2, 3, 9, 10, -3, 100, 2, 4, -5, 1, 10, -100, 5, 2, 3, -1, 1, -3, -4, -5, -6, -7, 9, 9, 9, 9, 9, 1, 2, 3, 4, 5, 100, 100, 100, 100, 100 }; return 0; }arrow_forward(V) USING NUMPY IN PYTHON, WRITE A PROGRAM TO CHECK WHETHER THE ARRAY GIVEN BELOW CONTAINS A NON-ZERO ELEMENT OR NOT. [0, 12, 0, 0, -1, O,0]arrow_forward
- (C++) PLEASE INCLUDE COMMENTS AND OUTPUT SCREEN Write a program that will do the following: In main, declare an array of size 20 and name it "randomArray." Use the function in step 2 to fill the array. Use the function in step 3 to print the array. Create a function that generates 20 random integers with a range of 1 to 10 and places them into an array. Re-cycle the functions from Lab 10 where appropriate. Make this a function. There will be two arguments in the parameter list of this function: an array and the size of the array. Within the function and the function prototype name the array: intArray. Within the function and the function prototype name the size of the array: size. The data type of the function will be void since the array will be sent back through the parameter list. Bring in the function that generates and returns a random number that you created from the previous module. Call that function from this within the loop that adds random numbers to the…arrow_forwardWrite C# statements to accomplish each of the following tasks: a. Display the value of the element of character array f with index 6. b. Initialize each of the five elements of one-dimensional integer array g to 8. c. Total the 100 elements of floating-point array c. d. Copy 11-element array a into the first portion of array b, which contains 34 elements. e. Determine and display the smallest and largest values contained in 99-element floating-point array w.arrow_forward(C PROGRAMMING ONLY) Thanks for fixing me! I am now okay. My next problem though is I don't know what to do with my life. Can you please show me? Instructions: In the code editor, you are provided with an array called me that contains 100 elements. Your task is to print all the elements of the array starting from the last element up to the first element. For this problem, using a loop would be very helpful. Outputarrow_forward
- PYTHONarrow_forwardNote:-Don't try to copy other's work otherwise I'll reduce rating for sure and will report. Don't use AI to generate answerarrow_forward(Indexing and Slicing arrays) Create an array containing the values 1–15, reshape it into a 3-by-5 array, then use indexing and slicing techniques to perform each of the following operations: Please use Python and keep it simple. a) Select row 2. b) Select column 4. c) Select rows 0 and 1. d) Select columns 2–4. e) Select the element that is in row 1 and column 4. f) Select all elements from rows 1 and 2 that are in columns 0, 2 and 4.arrow_forward
- (Sorting and Array in Ascending Order) Write a program that asks the user to input the number of elements of an integer array and its elements. The program then sorts the inputted array in ascending order. In C languagearrow_forward(c++)1. Body Mass Index (BMI) is a measure of health on weight. It can be calculated by taking your weight in kilograms and dividing by the square of your height in meters. Write a program that lets a teacher to calculate the BMI of 20 students. The program should use three one dimensional arrays named studWeight that holds the weight (in kilograms), studHeight that holds the height (in meters) and studBMI that holds the calculated BMI for each student. The program contains the following functions: a) readData: This function receives the studWeight and studHeight arrays from the main function. It reads the weight and height for all the students and stored them in the studWeight and studHeight arrays, respectively. b) calBMI: This function receives one element of the studWeight and studHeight arrays. It calculates the BMI of each student based on her/his weight and height, and then store the BMI in the studBMI array. c) display: This function displays the BMI of the students.arrow_forward(25 points) Assume you were given a sequence of exactly 5 quiz grades at runtime through sys.argv[] array. Write a program called final1.py that calculates the average quiz grade after dropping the lowest one. Here is what I would type in command prompt as an example: 1) python final1.py 80 80 45 70 70 2) python final1.py 75 55 90 100 95 3) python final1.py 0 0 80 80 80 The output for the examples above is: 1) Dropped 45, Average quiz grade = 75.0 2) Dropped 55, Average quiz grade = 90.0 3) Dropped 0, Average quiz grade = 60.0arrow_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
CPP Function Parameters | Returning Values from Functions | C++ Video Tutorial; Author: LearningLad;https://www.youtube.com/watch?v=WqukJuBnLQU;License: Standard YouTube License, CC-BY