3. Which of the following are correct ways of creating an aray? i) state[e] = "karnataka"; ii) $state[] = array("karnataka"); iii) Sstate[e] = "karnataka"; iv) $state = array("karnataka"); %3D %3D Select one: O a. ii) and i) O b. i) and iv) O. Only i) O d. i), i) and iv)
Q: An array of 20 floats intended to store marks as a percentage. #include #include const float…
A: Going through line by line to debug code.
Q: Create a struct called Booking that consists of a 3 digit flight number (e.g. 234), type of seat (E…
A: #include <iostream>#include <random>#include<iomanip>using namespace std;struct…
Q: Question 1. Write a console application with several functions that deal with a two-dimensional…
A: Program approach: Fill the 2 D array of size 20 X 20 with random values between 1 and 1000.…
Q: suppose the following declaration: int arr1[] new int[10]; int arr2[] = new int [5]; Write a method…
A: Java program to find common element between two array: import java.util.Arrays; public class Main {…
Q: The array was declared using the int grades[3][4] = {{88, 98, 85, 92}, {90, 94, 86, 20}, {40, 80,…
A: Two dimensional array is representation of elements in row column. In the above array declaration,…
Q: Create a class called ArrayModulus, with the following methods and requirements: • Declare a 5 by 4…
A: Required:
Q: Shipping a package A parcel services company can ship a parcel only when the parcel meets the…
A: NOTE: Since programming language is not mentioned. Therefore answering in Python language. First,…
Q: 4. Given the array declaration: int grades[3][5] = {80,90,96, 73,65,67, 90,68,92, 84,70,55,…
A: The declared 2D array has size has row size 3, and column size 5 that is the array can have maximum…
Q: You are a manager of a Wally's Training Gym and you encourage your trainers to enroll new members.…
A: Answer :
Q: Given the following array, int num[5]={3,6,9,12,15}, what will be the value of score for the given…
A: The given array is, int num[5] = {3,6,9,12,15} In array all the elements are at a index, from which…
Q: Consider the following array declaration: double a[10] = { 1.1 , 2.2, 3.3, 4.4, 5.5 }; Write a…
A: We will input the size of the array. Then we will input the elements of the array. Then we will pass…
Q: 1- Write a program that finds a total, average student score in 5 subjects, and these grades are as…
A: // 1 - // C++ Source Code :- #include <bits/stdc++.h>using namespace std; int main() { //…
Q: Daily average temperature information of one year city is kept in a one-dimensional array. Daily…
A: Code: #include <stdio.h>int fun(int arr[],int size)//defining the function{ int…
Q: Wally's Training Gym and you encourage your trainers to enroll new members. Input is the trainer's…
A: Here, gym trainer name and how many enrolled members this show and also divided three category…
Q: Look at the following array definition. double sales[8][10];A) How many rows does the array have?B)…
A: double sales[8][10]; It has 8 rows
Q: When defining a 2-dimensional array, you MUST: A Assign all of its elements in the declaration…
A: A two dimension array is a collection of elements arranged in rows and columns Note: As per our…
Q: Create a class called 'Matrix' where initializes the number of rows and number of columns of a new…
A: ALGORITHM:- 1. Create a class representing Matrix. 2. Take input for rows & columns value. 3.…
Q: Question 2. Analyze the below code: #include int sum(int aryll,int x); int main(void) { int…
A: a. #include<stdio.h>int sum(int ary[],int x);int main(void){int new_array[3];int…
Q: Create a struct called Booking that consists of a 3 digit flight number (e.g. 234), type of seat (E…
A: The program is written in c to get the desired output
Q: Question 1. Write a console application with several functions that deal with a two-dimensional…
A: The problem shows a need to print a table that contains random at some indexes prime numbers and 0s…
Q: Write an application that stores the following nine integers in an array: 10, 15, 19, 23, 26, 29,…
A: Program : public class Main { public static void main(String[] args) { final int intager_Num = 9;…
Q: Q2] Write a program that enters the name of several students with a number of their grades in a…
A: NOTE Below is the answer for the given question. Hope you understand it well. If you have any…
Q: Question 31 Which method call would print the items in a perfect size array? Assume shoppingList is…
A: - We have to talk for printing a perfect sized array with the options provided. - The options :-…
Q: f J[2][1] in the following array declaration? int[][] J= {{5, 10 }, {15, 20, 25}, {30, 35}}; a. 20
A: What is the value of J[2][1] in the following array declaration? int[][] J= {{5, 10 }, {15, 20, 25},…
Q: Each of two players rolls a dice and whoever rolls the highest number (between 1 and 6 inclusive)…
A: Actually, program is a executable software that runs on a computer. The given information Each of…
Q: Create a class called ArrayModulus, with the following methods and requirements: • Declare a 5 by 4…
A: 1. create a function to calculate the modulus.2. take the array of two dimension randomly.3. use…
Q: Complete the missing parts of the declaration and assignment of an array of ints named scores,…
A: Java follows the object-oriented paradigm. In java, everything is in the form of an object so while…
Q: Create a struct called Booking that consists of a 3 digit flight number (e.g. 234), type of seat (E…
A: #include<iostream> using namespace std; //creating a structure with specified fields struct…
Q: (Game: ATM machine) Use the Account class created in our previous Lab Exercise to simulate an ATM…
A: GIVEN QUESTION:- Game: ATM machine) Use the Account class created in Programming Exercise 8.7 to…
Q: eate a class called 'Matrix' containing constructor that initializes the number of rows and number…
A: EXPLANATION: - The Matrix class comprises three instance variables namely for the rows, columns,…
Q: What is the purpose of the following code segment, assuming myList is initialized with random…
A: Actually, program is a executable software that runs on a computer.
Q: Question 1 (Marks: 30) Write a Java program to display three monthly sales of different vehicle…
A: Here have to determine about java code for given 2d type problem.
Q: QUESTION 2: Class Rectangle has two data members, length (type of float) and width (type of float).…
A: The correct option is option B. arrayRectangle[1].setLength(4.15);…
Q: 1) Create a array of Fahrenheit temperatures, as follows int fahr []=…
A: Program Instructions:Define the given array in code and calculate the size of the array.Use for loop…
Q: $RegCourses, Calculate your GPA , the best grad and the worst one
A: Raw Code: import java.util.*;import java.lang.*;import java.io.*; class Main{public static void main…
Q: Consider the following code and answer the questions. double ary[] = {5, 1.2, 8.7, 9.6, 8.1,…
A: I gave answered the question in step 2.
Q: 2.2 A struct employeeType has been declared with two elements: name and salary. a. Declare an…
A: Here we have given a program in c that declares a structure with a name as string and salary as…
Q: Question 4: Consider an array named Student [10] in which you have stored the record of university'…
A: #include<iostream> #include<ctime> using namespace std; struct Student{ int…
Q: You have collected reviews from four movie reviewers where the reviewers are numbered 0-3. Each…
A: C++ used to answer this question
Q: 19. Write a pr in the computer's memory. should store the player's name and the other array should…
A: The code is below check..
Q: Question 19 A Consider the following statement, which is intended to create an ArrayList named years…
A: Answer: A. ArrayList years ArrayList years=new ArrayList(), This statement is old non generic…
Q: C++ Chapter 7 - 1D Array - The 3n + 1 problem please solve the question new solution, don't copy…
A:
Q: Given the following array definition: int values[5] = { 4, 7, 6, 8, 2 };What does the following…
A: GIVEN: Given the following array definition: int values[5] = { 4, 7, 6, 8, 2 };What does the…
Q: Analyze the below code and fill in the blanks to complete the code #include int main() { int…
A: We are given a C code and in this code we are simply printing elements of two arrays named…
Q: Below is an application in which the number of days for each month in the year is stored in an…
A: We have three line to modify here initialize DAYS array add output statement. increment looping…
Q: Determine whether the following array declarations are valid. If a declaration is valid, determine…
A: The following are the valid array declarations: 1. int list[] = {18, 13, 14, 16}; // Size of the…
Q: Q1.Write a program to find the total and percentage of marks of 5 subjects stored in array in apex…
A: We need to write a program to find the total and percentage of marks of 5 subjects stored in array…
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images
- Write an C++ that uses a class called “Book” (see details below). The application must perform the following tasks. Create an array of “Book” objects (i.e., array must be able to store 2 books). Create 2 “Book” objects initialized as follows. o title = “C++ Textbook”; Author = “Pete Parker”; Publisher = “Cengage”, ISBN = “0123456789”; subject = “Computer Programming”; o title = “Java Textbook”; Author = “Bruce Wayne”; Publisher = “McGraw Hill”, ISBN = “9876543210”; subject = “Computer Programming”; Add the two books to the array. o Assume the two publishers have merged into a new company called “BookConglomerate”. Use a loop to create statements to modify the publisher field with the new publisher name. Display the following information for both books o Book Title (i.e., “C++ Textbook” or “Java Textbook”) o Author o Publisher o ISBN o Subject The Book class must contain the following. Constructor with parameters that initialize all instance variables title, author,…1. Create a struct called Booking that consists of a 3 digit flight number (e.g. 234), type of seat (E or B), the priceof a seat in economic class and the number of seats booked.Declare an array to store at least 30 Booking structs. (4)2. The user must be able to enter the information for a number of bookings from the keyboard. Ask whether abooking must be made (Y or N). If a booking must be made, a random 3 digit flight number must be generated.The user must be asked to enter the type of seat, the price per seat and the number of seats to book.3. Write code to display a numbered list with all the information of all the bookings. The price per ticket must bedisplayed with 2 decimal places. The output must be displayed with a heading and subheading 4. Write code to calculate and display the income earned per booking. Display headings and subheadings.Also count and display the number of business seats and economics seats booked as well as the incomeearned from each of these types of…an int variable k, an int array currentMembers that has been declared and initialized, an int variable nMembers that contains the number of elements in the array, an int variable memberID that has been initialized, and a bool variable isAMember, Write code that assigns true to isAMember if the value of memberID can be found in currentMembers, and that assigns false to isAMemberotherwise. Use only k, currentMembers, nMembers, and isAMember.
- 2.2 A struct employeeType has been declared with two elements: name and salary.a. Declare an employeeType struct array for 100 employees. b. Write a code snippet of the loop that will accept the details of the 100 employees.1. Create a struct called Booking that consists of a 3 digit flight number (e.g. 234), type of seat (E or B), the priceof a seat in economic class and the number of seats booked.Declare an array to store at least 30 Booking structs. 2. The user must be able to enter the information for a number of bookings from the keyboard. Ask whether abooking must be made (Y or N). If a booking must be made, a random 3 digit flight number must be generated.The user must be asked to enter the type of seat, the price per seat and the number of seats to book.Example of input:(Electrical eng.) Write a program that declares three one-dimensional arrays named volts, current, and resistance. Each array should be declared in main() and be capable of holding 10 double-precision numbers. The numbers to store in current are 10.62, 14.89, 13.21, 16.55, 18.62, 9.47, 6.58, 18.32, 12.15, and 3.98. The numbers to store in resistance are 4, 8.5, 6, 7.35, 9, 15.3, 3, 5.4, 2.9, and 4.8. Your program should pass these three arrays to a function named calc_volts(), which should calculate elements in the volts array as the product of the corresponding elements in the current and resistance arrays (for example ,volts[1]=current[1]resistance[1]). After calc_volts() has passed values to the volts array, the values in the array should be displayed from inside main().
- var newStaff =new Employee[3]; is used to: Select one: a. Creates and initializes an Array with three objects of type Employee b. The statement is not valid in Java c. Create an Array to store two Employee objects d. Create an Array to store three objects of type EmployeeBelow is an application in which the number of days for each month in the year is stored in an array. (Forexample, January has 31 days, February has 28, and so on. Assume that the year is not a leap year.) Display 12sentences in the same format for each month; for example, the sentence displayed for January is Month 1 has 31days. Given the following pseudocode, fill in the missing lines of code (see bold portions):class MonthDaysmain() //Declarations num month num SIZE = 12 num DAYS finish declaring arraymonth = 0while month < SIZE output complete output statement month = ____________endwhilereturnendClass2.2 A struct employeeType has been declared with two elements: name and salary.a. Declare an employeeType struct array for 100 employees in c++. b. Write a code snippet of the loop that will accept the details of the 100 employees.
- Create an associative array $RegCourses, the Indices are the names of your registered courses last semester and the values are your grades.–Print out the contents with its indices in a vertical table–Based on $RegCourses, Calculate your GPA , the best grad and the worst one•Create an associative array $BatCompanions that hold the information of The battles of the companions (up to 4 battles). the Indices are the names of battles and the values are the names of the commanders.in C#, Visual Basic Write an app for Boston Airlines that allows a customer to reserve a seat on the airline’s only plane (capacity: 10 seats). Radio buttons should allow the choice between First Class and Economy. The app should then assign a seat in the first-class section (seats 1–5) or the economy section (seats 6–10). Use a one-dimensional array of type bool to represent the seating chart of the plane. Initialize all the elements of the array to false to indicate that all the seats are empty. As each seat is assigned, set the corresponding element of the array to true to indicate that the seat is no longer available. Your app should never assign a seat that has already been assigned. When the economy section is full, your app should ask the person if it is acceptable to be placed in the first-class section (and vice versa). If yes, make the appropriate seat assignment. If no, display the message “Next flight leaves in 3 hours."Create a struct called Booking that consists of a 3 digit flight number (e.g. 234), type of seat (E or B), the priceof a seat in economic class and the number of seats booked.Declare an array to store at least 30 Booking structs. The user must be able to enter the information for a number of bookings from the keyboard. Ask whether abooking must be made (Y or N). If a booking must be made, a random 3 digit flight number must be generated.The user must be asked to enter the type of seat, the price per seat and the number of seats to book. Example of input: Make a booking (Y or N): Y Type of seat (E or B): e Price per seat : 1200 Number of seats: 2 Make another booking (Y or N): y Type of seat (E or B): b Price per seat : 3400 Number of seats: 2 Make another booking (Y or N): y Type of seat (E or B): e Price per seat : 1400 Number of seats: 3 Make another booking (Y or N): y Type of seat (E or B): e Price per seat : 1300 Number of seats: 2 Make another booking (Y or N): y Type of…