Look at the following array definition.
double sales [8] [10];
A) How many rows does the array have?
B) How many columns does the array have?
C) How many elements does the array have?
D) Write a statement that stores 3.52 in the last column of the last row in the array.
Questions 28- 30 are for students who have covered Chapter 7 on classes and structures. These questions use the following Car structure declaration.
struct Car
{
string make,
model;
int year;
double cost ;
// Constructors
Car()
{make= model=""; year= cost= O; }
Car(string mk, string md, int yr, double c)
{ make= mk; model = md; year= yr; cost = c; }
} ;
Want to see the full answer?
Check out a sample textbook solutionChapter 8 Solutions
Starting Out With C++: Early Objects (10th Edition)
Additional Engineering Textbook Solutions
Database Concepts (8th Edition)
Concepts of Programming Languages (11th Edition)
Concepts Of Programming Languages
Starting Out with Java: From Control Structures through Objects (6th Edition)
Programming in C
Digital Fundamentals (11th Edition)
- A(n) _________ may be used to pass arguments to the constructors of elements in anobject array.arrow_forwardDrink Machine Simulator Write a program that simulates a soft drink machine. The program should use a structure that stores the following data: Drink Name Drink Cost Number of Drinks in Machine The program should create an array of five structures. The elements should be initialized with the following data: Drink Name Cost Number in Machine Cola .75 20 Root Beer .75 20 Lemon-Lime .75 20 Grape Soda .80 20 Cream Soda .80 20 Each time the program runs, it should enter a loop that performs the following steps: A list of drinks is displayed on the screen. The user should be allowed to either quit the program or pick a drink. If the user selects a drink, he or she will next enter the amount of money that is to be inserted into the drink machine. The program should display the amount of change that would be returned, and subtract one from the number of that drink left in the machine. If the user selects a drink that has sold out, a message…arrow_forwardPseudocode for the student grade calculator program, please Create a program to enter grades and calculate averages and letter grades. Need a class which will contain: Student Name Student Id Student Grades (an array of 3 grades) A constructor that clears the student data (use -1 for unset grades) Get functions for items a, b, and c, average, and letter grade Set functions for items a, n, and c Note that the get and set functions for Student grades need an argument for the grade index. Need another class which will contain: An Array of Students (1 above) A count of number of students in use You need to create a menu interface that allows you to: Add new students Enter test grades Display all the students with their names, ids, test grades, average, and letter grade Exit the program Add comments and use proper indentation. Nice Features: I would like that system to accept a student with no grades, then later add one or more grades, and when all grades are entered, calculate the…arrow_forward
- Write a statement that declares a class-level two-dimensional array named intOrders. The array should contain five rows and three columns.arrow_forwardC++ Visual Studio 2019 Complete #7 Customer Accounts and #8 Search Function for Customer Accounts Program. Create the array with only 2 elements. 7.Customer Accounts Write a program that uses a structure to store the following data about a customer account: Name Address City, State, and ZIP Telephone Number Account Balance Date of Last Payment The program should use an array of at least 10 structures. It should let the user enter data into the array, change the contents of any element, and display all the data stored in the array. The program should have a menu-driven user interface. Input Validation: When the data for a new account is entered, be sure the user enters data for all the fields. No negative account balances should be entered. 8. Search Function for Customer Accounts Program Add a function to Programming Challenge 7 (Customer Accounts) that allows the user to search the structure array for a particular customer's account. It should accept part of the customer's name as an…arrow_forwardAn array definition reserves space for the array. true or falsearrow_forward
- Create a structure representing a student object with the following members regno. courseid unitsRegistered: This should be an array of the course units you registered to capture marks unitsmarks: This should be an array to store the marks for the units registered. Find a way to relate the two. firstname surname address By using the structure above, write a program that populates the details of a student and compute the average, and the grade as well as the total marks. This task should be accomplished by writing functions for getData() - to populate the structure, printStudent() - to display the detail of the student, computeGrade() - to compute the grade of the student and computeMean() that computes the mean of the students: Pass the appropriate data NB: The function getData() - is a subroutine and uses structure as a reference - input, same concept to printData() Consider that your class has 10 students. Compute the class mean and standard deviation, highest class mark and lowest…arrow_forwardCreate a struct called Booking that consists of a 3 digit flight number (e.g. 234), type of seat (E or B), the price of a seat in economic class and the number of seats booked. Declare an array to store at least 30 Booking structs.arrow_forwardPlease see the image below. Choose the correct answer from the choicesarrow_forward
- You can assign the contents of one array to another by using the assignment operator. the equality operator. both array names. A and C together. none of the above.arrow_forwardAssignment 5C: Level Map Creator. There are a variety of ways that game developers store their level layouts. One simple method is to associate level elements with certain symbols, and then storing them in a 2D grid inside a text file. We will use our knowledge of 2D arrays to create a very simple Level Map Creator tool. The program should prompt the user to enter a width and height for the level. Then it should initialize a 2D array and fill every element with the *" symbol. Afterwards, the user should be given the following options via a menu: 1. Clear Level 2. Add Platform Prompt the user to enter a starting point and length for the Re-initialize the 2D array and fill every element with the "** symbol. horizontal platform. Replace those elements in the 2D array with the "=" symbol. If the length is longer than the number of columns |(or out of bounds), notify the user that this is not possible. Prompt the user to enter a column and row index. Replace that element in the 2D array…arrow_forwardTrue or False Topic: Visual Basic a. Each array element has a unique subscript (or index) assigned to it. indexing assignment begins at 1. b. Every element in the array must be the same data type.arrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT