1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
jarptica [38.1K]
2 years ago
15

Define a method named orderOfAppearance() that takes the name of a role as an argument and returns that role's order of appearan

ce. If the role is not found, the method returns 0. Ex: orderOfAppearance("Forrest Gump") returns 1. Hint: A method may access the object's properties using the keyword this. Ex: this.title accesses the object's title property.
// Code will be tested with different roles and movies
let movie = {
title: "Forrest Gump",
director: "Robert Zemeckis",
composer: "Alan Silvestri",
roles: [ // Roles are stored in order of appearance
"Forrest Gump",
"Young Forrest Gump",
"Jenny Curran",
"Lieutenant Dan Taylor"
],
orderOfAppearance: function(role) {

}
};
Computers and Technology
1 answer:
ioda2 years ago
6 0

The method named orderOfAppearance() that takes the name of a role as an argument is; Written as below

<h3>How to write a Program in Java?</h3>

The steps to write this Java program is as follows;

  • 1) Initialize the movie JSON (JavaScript Object Notation) having the name, director, composer and title properties.
  • 2) Define a roleOf: function that has a name parameter.
  • 3) Check whether the selected is not equal to undefined and then return that name.
  • 4) Otherwise display this message: "0".

let movie = {

  name: "Forrest Gump",

  director: "Robert Zemeckis",

  composer: "Alan Silvestri",

  title: {

      "Forrest Gump",

      "Young Forrest Gump"

      "Jenny Curran"  

       "Lieutenant Dan Taylor"            

  },

  orderOfAppearance: function (role) {

      if (typeof (this.title[role]) !== 'undefined') {

          return this.title[role];

      } else {

          return "0";

      }

  }

};

Read more about java programming at; brainly.com/question/16397886

You might be interested in
Which of the following is the single best rule to enforce when designing complex passwords?
saw5 [17]

Answer:

B. Longer passwords

Explanation:

If the password is longer, it requires more incorrect attempts to find it, so the system could identify a potential hacker attempt. Smaller but more complex passwords could be identified by mistype or forgotten passwords.

3 0
3 years ago
How do you change ip?
Fittoniya [83]
Unplug your router and plug it back in :)

Otherwise if you have a static IP contact your ISP for them to change it :D
5 0
3 years ago
In C++ the declaration of floating point variables starts with the type name double, followed by the name of the variable, and t
Vadim26 [7]

Answer:

See explaination

Explanation:

Given a partial grammar which represents the specification for C++ style variable declaration. In this range a - z indicates terminals that represents the variable names.

'S' is the start symbol of the

non-terminal.

Hence, given,

S= TV

V= CX

Please kindly refer to attachment for further instructions and complete step by step solution.

8 0
4 years ago
A computer's hard disk drive holds 8 x 10^10 bytes of information. If Jill buys an extra memory stick that holds 5.1 X 10^8 byte
denis-greek [22]

Answer:

The computer will store 8.05 *10^10 bytes of information.

Explanation:

This is the same as saying that the computer will now have 80.51 Gigabytes ( 1gb = 1.000.000.000 bytes) of storage. In this case, the number is represented in its decimal form, and the previous one is displayed in Scientific Notation.

8 0
3 years ago
True or false
ICE Princess25 [194]
1. True
2. Usually true, but it depends on the search engine you're using.  For example, Google lets you search for several words without commas.
3 0
3 years ago
Other questions:
  • True False The explicit location always tells you where users are located when they type the query.
    10·2 answers
  • What are the links between the operating systems, the software, and hardware components in the network, firewall, and IDS that m
    7·1 answer
  • Which Internet security risk is associated with dumpster diving?
    15·2 answers
  • This is important I need help please
    14·1 answer
  • What information is kept in the cached lookups folder for a dns server?
    9·1 answer
  • If a DirectAccess user has issues with their laptop or remote device, what can be enabled to facilitate help desk personnel get
    11·1 answer
  • Where do deleted files go?
    7·2 answers
  • Technical colleges offer certification in audio engineering through programs that are normally from 2 to 6 months long. False Tr
    14·1 answer
  • A quality assurance test for digital imaging receptors is to check for dark noise. What is the purpose of this test?
    8·1 answer
  • A chain of dry-cleaning outlets wants to improve its operations by using data from
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!