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
Lemur [1.5K]
3 years ago
12

Consider the following code: // Merge mailing list m2 into m1 void merge (MailingList m1, MailingList m2) { for (int i = 0; i &l

t; m2.numEntries(); ++i) m1.add (m2.getEntry(i)); } The programmers who first encountered this code fragment weren’t sure if it was in C++ or Java. In fact, with the addition of some appropriate declarations, it would probably compile correctly in either language. Which language is it? Explain your answer.
Computers and Technology
1 answer:
Inessa [10]3 years ago
3 0

Answer:

That is a Java language

Explanation:

This is simply Because C++ language does not support the calling of the methods without parameters and with the .(dot) operator.

It can also be clearly noted that This is the functionality of Java, for example, to sort we call Array.Sort().

So the parameter here is passed by placing the variable at front with the . (dot).

You might be interested in
Design a finite automata from regular expression 10(0+11)0*1
Vilka [71]
<h3>What is a Finite automata?</h3>

A finite state machine (FSM) or finite state automaton (FSA), or simply a state machine, is a mathematical model of computation. It is an abstract machine that can be in exactly one of a finite number of states at any given time. The FSM may change from one state to another in response to some input; the change from one state to another is called a transition. An FSM is defined by a list of its states, its initial state, and the inputs that trigger each transition. Finite-state machines are of two types - deterministic finite-state machines and non-deterministic finite-state machines. A deterministic finite-state machine can be constructed equivalent to any non-deterministic machine.

With that being said, the DFA is equivalent to the expression 10(0+11)0*1 The expression that you've specified requires at least three 1 to be accepted. Breaking it down into parts.

<h3>Writting the automata:</h3>

<em>S0: 1 => S1        ; 1 </em>

<em>S0: 0 => error     ; 0 </em>

<em>S1: 0 => S1        ; 10+ </em>

<em>S1: 0 => S2        ; 10(0 </em>

<em>S2: 0 => S2 </em>

<em>S2: 1 => S3 </em>

<em>S3: 1 => S4 </em>

<em>S4: 0 => S4 </em>

<em>S4: 1 => S5 </em>

<em>S5: 1 => S6 (final state) </em>

See more about automata at brainly.com/question/14937298

#SPJ1

7 0
2 years ago
What is the characteristics of a spear phishing message
Cerrena [4.2K]
It is targeted at one person specifically. More work for the attacker, but higher chances of obtaining sensitive information.
7 0
3 years ago
Read 2 more answers
The theory of continental drift is supported by all of the following EXCEPT
Stels [109]
Climate seems like the correct answer
8 0
3 years ago
Please answer<br><br>NO LINKS​
Alex_Xolod [135]

Answer:

Please find the attached file for the complete solution:

Explanation:

6 0
3 years ago
Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both doubles) as input, and output the g
zepelin [54]

Answer:

Explanation:

The following is written in C++ and asks the user for inputs in both miles/gallon and dollars/gallon and then calculates the gas cost for the requested mileages using the input values

#include <iostream>

#include <iomanip>

using namespace std;

int main () {

   // distance in miles

   float distance1 = 20.0, distance2 = 75.0, distance3 = 500.0;

   float miles_gallon, dollars_gallon;

   cout << "Enter cars miles/gallon: "; cin >> miles_gallon;

   cout << "Enter cars dollars/gallon: "; cin >> dollars_gallon;

   cout << "the gas cost for " << distance1 << " miles is " << fixed << setprecision(2) << (float) dollars_gallon * distance1 / miles_gallon << "$\n";

   cout << "the gas cost for " << distance2 << " miles is " << fixed << setprecision(2) << (float) dollars_gallon * distance2 / miles_gallon << "$\n";

   cout << "the gas cost for " << distance3 << " miles is " << fixed << setprecision(2) << (float) dollars_gallon * distance3 / miles_gallon << "$\n";

   return 0;

}

8 0
3 years ago
Other questions:
  • Which are appropriate uses for special effects in presentations?
    14·1 answer
  • Function of network security​
    9·1 answer
  • In 5-10 sentences, describe the purposes, design considerations, and common elements of most brochures.
    6·1 answer
  • Once a manual is written, it may change over time as procedures change. What's a recommended format for a manual to incorporate
    9·1 answer
  • The _______ displays the data series in separate columns side-by-side so that you can compare the relative heights of the column
    5·2 answers
  • A testing lab wishes to test two experimental brans of outdoor pain long each wiil last befor fading . The testing lab makes six
    11·1 answer
  • If a salesperson were trying to sell this cabin, which word would be best to use to make its size seem most positive?
    7·2 answers
  • Take two String inputs of the same length and merge these by taking one character from each String (starting with the first ente
    8·2 answers
  • Basic computer programs used by a variety of companies include:
    5·1 answer
  • Which objects appear on the slide after she clicks ok? Check all that apply.
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!