Question

In: Mechanical Engineering

Create a structure array that contains the following information fields concerning the road bridges in a town

Create a structure array that contains the following information fields concerning the road bridges in a town: bridge location, maximum load (tons), year built, year due for maintenance. Then enter the following data into the array:

Location Max. load Year built Due for maintenance Smith St. Hope Ave. Clark St. North Rd. 80 90 85 100 1928 1950 1933 1960 2011 2013 2012 2012

Solutions

Expert Solution

Array structure:

 

%You can create this array by typing the following either in interactive mode or in a script
%file and running it.
A(1,1)={\'bridge location\'};
A(1,2)={\'Max.load\'};
A(1,3)={\'year built\'};
A(1,4)={\'due of maintanance\'};
A{2,1} = {\'SmitSt\';\'HopeAve\';\'ClarkSt\';\'NorthRd\'};
A{2,2} = {[80;90;95;100]};
A{2,3} = {[1928;1950;1933;1960]};
A{2,4} = {[2011;2013;2012;2012]};
%Type A at the command line. You will see
%You can use the celldisp function to display the full contents. For example, typing
%celldisp(A)


Array structure:

 

%You can create this array by typing the following either in interactive mode or in a script

Related Solutions

You need a data structure that contains fields for name (char array), color (char array), age...
You need a data structure that contains fields for name (char array), color (char array), age (int), and height (int). Name the struct Info when you define it. Create a function named getUserInfo() that asks the user for name, color, age, and height and then returns a data structure containing that information. It should do the following: What is your name? George What is your favorite color? Green What is your age? 111 What is your height in inches? 72...
***IN C++*** Create student structure with the following fields:  Name (cstring or null-terminated character array)...
***IN C++*** Create student structure with the following fields:  Name (cstring or null-terminated character array)  Student ID (int – unique random value between 1000 and 9999)  grade (char – Values A thru F)  birthday (myDate – random value: range 1/1/2000 to 12/31/2005)  Home Town (string) Create an array of pointers to students of size 10. Example: Student *stuPtr[10]; Write a function that populates the array with 10 students. Example: populate(stuPtr); Write a display function that...
3) Create a nested structure (one structure that contains another) and print out all the fields...
3) Create a nested structure (one structure that contains another) and print out all the fields in both structures. The main structure should have fields for: movie name and the year it was released. The extended structure should include the original structure as well as fields for: Lead actor, genre and runtime. In C 4) Create a structure for an employee which contains a field for: first name, last name, id and salary. Then use printf and scanf to fill...
The tbl_employee contains information about the employee and its department, and it contains the following fields...
The tbl_employee contains information about the employee and its department, and it contains the following fields (it is possible to also include other missing fields): employee_id, employee_gender ,employee_salary, employee_annual_sallary, department_name, department_location, department head. Make use of the database normalization skills learned to normalize a database to the third normalization form. Organize the columns and tables to reduce data redundancy and arrange attributes based on the relationships. Provide a screen shot of the database design before the normalization. Create a heading...
In a header file Record.h, create a Record structure that contains the following information: recordID, firstName,...
In a header file Record.h, create a Record structure that contains the following information: recordID, firstName, lastName, startYear. recordID is an integer. In testRecord, first create a record (record1) using “normal” pointers. Set the values to 1001, Fred, Flintstone, 1995 In testRecord, create a new record (record2) using a unique smart pointer. Set the values to 1002, Barney, Rubble, 2000 Create a function (or functions) that will print the records to any output stream. Since the print function does not...
Create a class named Horse that contains the following data fields: name - of type String...
Create a class named Horse that contains the following data fields: name - of type String color - of type String birthYear - of type int Include get and set methods for these fields. Next, create a subclass named RaceHorse, which contains an additional field, races (of type int), that holds the number of races in which the horse has competed and additional methods to get and set the new field. ------------------------------------ DemoHorses.java public class DemoHorses {     public static void...
Create a class named Sandwich that contains the following data fields: MainIngredient - of type String...
Create a class named Sandwich that contains the following data fields: MainIngredient - of type String Bread - of type String Price - of type Double Include get and set methods for these fields. The methods should be prefixed with 'get' or 'set' respectively, followed by the field name using camel case. For example, setMainIngredient. Use the application named TestSandwich that instantiates one Sandwich object and demonstrates the use of the set and get methods to test your class. ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------...
JAVA: Create a circle that contains the following... Sample code to work from provided below. FIELDS:...
JAVA: Create a circle that contains the following... Sample code to work from provided below. FIELDS: a private double that holds the radius. CONSTRUCTORS a no argument constructor that sets the radius to zero a constructor that takes a single argument of type double which is the radius. METHODS a method called "getRadius" which returns the current radius a method called "setRadius" which takes a single parameter of type double containing the new radius a method called "getArea" which returns...
Create a C++ program that makes use of both concepts i.e. Array of structure and array...
Create a C++ program that makes use of both concepts i.e. Array of structure and array within the structure by using the following guidelines: 1. Create an Array of 5 Structures of Student Records 2. Each structure must contain: a. An array of Full Name of Student b. Registration Number in proper Format i.e 18-SE-24 c. An array of Marks of 3 subjects d. Display that information of all students in Ascending order using “Name” e. Search a particular student...
Create a program in java with the following information: Design a program that uses an array...
Create a program in java with the following information: Design a program that uses an array with specified values to display the following: The lowest number in the array The highest number in the array The total of the numbers in the array The average of the numbers in the array Initialize an array with these specific 20 numbers: 26 45 56 12 78 74 39 22 5 90 87 32 28 11 93 62 79 53 22 51 example...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT