Elevations of the great lakes in vectors

Assignment Help Computer Engineering
Reference no: EM132091578

Pascal allows the use of enumerated types as index types. For example, if we define the enumerated type GreatLakes to have the values Erie, Ontario, Huron, Michigan, and Superior (ordered here by increasing volume of water), then we can define:

type GreatLakes = (Erie, Ontario, Huron, Michigan, Superior);

area: array [ GreatLakes ] of integer,

elevation: array [ GreatLakes ] of real;

(and give them values)

area := ( 9910, 7340, 23000, 22300, 31700 );

elevation := ( 570.38, 244.77, 578.68, 578.68, 600.38 );

Now we can access individual elements to find, for example, that

area[Erie] = 9910

area[Superior] = 31700

elevation[Huron] = elevation[Michigan] = 576.68

In the above definitions we stored the areas and elevations of the Great Lakes in vectors (1- dimensional arrays).

Restate these definitions in order to store the same information in a structure that is:

(a) A vector of records

For defining records, use the syntax:

Person: record

age: integer;

sex: (Male, Female);

height, weight: real;

married: Boolean;

end;

(b) A record of vectors

(c) A 2-dimensional array indexed by type GreatLakes and by another enumerated type.

Reference no: EM132091578

Questions Cloud

What is elements of a strategic plan : What is elements of a strategic plan and explain why strategic planning is important in global environment?
Primary difficulties associated with a middle-aged person : What do you think are some of the primary difficulties associated with a middle-aged person?
Describe appropriate selectional restrictions on the verbs : Cluster these senses using the definitions of homonymy and polysemy given in chapter 19 (Speech and Language Processing -Jurafsky Martin).
Create a user friendly gui app using the code parameters : Display a message dialog similar to the one shown in listing 2.12, but the message must pertain to VendingChange and not ChangeMaker.
Elevations of the great lakes in vectors : Pascal allows the use of enumerated types as index types.In the above definitions we stored the areas and elevations.
Create a scanner to process the string : You can use a Map where the keys are the Integer length and the values are the Set of the words of that length. This is similar to hw 17.
What is the average case time complexity for linear search : What is the average case time complexity for linear search on a sorted array? Explain (and/or draw a diagram).
Primary objective of statistical process control : Describe the primary objective of statistical process control.
Why is it important for operations managers : Why is it important for operations managers to understand the local culture and practices of the countries

Reviews

Write a Review

Computer Engineering Questions & Answers

  Would you have no fear of the one who is in authority

This conversation is becoming more and more an issue than ever before. The definition for eavesdrop is 'to listen secretly to a private conversation.

  What are the three components to define a computer bus

Why, and in what sense, are the DIN 4164 standard connectors specified by the VMEbus standard better than the connectors used by the IBM PC bus?

  Assignment- virtualization and cloud computing world

Assignment: Virtualization and Cloud Computing World, The popularity and rapid adoption of Software as a Service (SaaS), Platform as a Service (PaaS), and Infrastructure as a Service (IaaS) by a number of organizations has impacted internal IT / IS..

  What is the exception with the highest priority

Why does the location of the 68000s reset vectors cause the system designer so many problems? Why are the 68010, 68020, and 68030 much better in this respect?

  Find the probability that there are 63 or more users

A packet switch has 5 users, each offering packets at a rate of 10 pps. The average length of the packets is 1024 bits.

  Write a program that has two threads

Write a program that has two threads. The first thread a simple loop that continuously increments a counter and prints a period (".") whenever the value.

  How the final web page must include

The final Web page should include the following HTML elements and formatting.

  Which code review methodology

As a quality assurance manager, which code review methodology - walkthrough or inspection - would you recommend? Justify your answer.

  Differences between the java programming languages

What are the main differences between the Java programming language and the language discussed

  Program that ask user to enter insurance company name

Write a program that will ask the user to enter the insurance company name, year, the number of insurance policies sold of each car insurance type. The average insurance premiums of each car insurance policy type are $500, $650 and $800

  Draw the memory mar and mbr configurations

Four of the 32 pages of the memory of Problem must be accessible at any time. Four auxiliary 5-bit registers, each containing a page address.

  Why it is necessary to use database system

Why it is necessary to use database system? What kinds of information this database system collect? and what information it provides?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd