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
Marina86 [1]
3 years ago
5

I am getting two expected errors on this code for the bottom two “public static void” lines. Can someone tell me how I can fix i

t? Thanks

Computers and Technology
1 answer:
AVprozaik [17]3 years ago
7 0

Answer:

Declare variable b in both lines

i.e. int b

Explanation:

In the given code, the parameters of both functions were not properly declared.

When listing the parameters, the data type must be clearly stated for all parameters (individually)

In the declaration of both functions, only variable a is declared as integer while b is undeclared.

So, the correction is to declare b as integer

You might be interested in
Which of the following is not the name of an air mass?
Rus_ich [418]
<span>All the terms are adjectives, not names of air masses. But among the adjectives, tepid seems to be the odd one out.</span>
5 0
3 years ago
A key or combination of keys that complete an action more efficiently than using the mouse is called a(n) keyboard shortcut.
andreev551 [17]
The answer to your question is true
6 0
3 years ago
Question 1
anastassius [24]

Answer:

51 \frac{y81 >  \leqslant  =  \times  - 9 {55lol \: noob \times \frac{?}{?} }^{2}  \times \frac{?}{?} }{?}

8 0
2 years ago
They always water the garden in the morning. (Underline the verb in the sentence)​
valina [46]

Answer:

Water

Explanation:

A verb describes an action, an occurrence, or a state of being. Watering is an action.

8 0
3 years ago
Read 2 more answers
Now, extend your test program by adding a second function named split that will identify all the individual values in a comma se
otez555 [7]

Answer:

The code to copy is :

#include <iostream>

#include <string>

using namespace std;

string nextString(string str, int start_index);

int split(string str, string a[], int max_size);

int main()

{

const int VALUES = 20;

string somestring;

string varray[VALUES];

//Prompt the user to enter a comma separated string

cout << "Enter a comma seperated string: ";

//read the string

getline(cin, somestring);

//call split() method on the given string and

//store the count of individual strings in cnt

int cnt = split(somestring, varray, VALUES);

//Print the individual strings

for (int i = 0; i<cnt; i++)

cout << varray[i] << endl;

return 0;

}

//returns a sub string that starts at strat_index

//in the given string and ends before a comma

string nextString(string str, int start_index)

{

int i;

//find a comma or end of the string, after strat_index

for (i = start_index;i < str.length();i++)

{

//if comma is found, exit the loop

if (str.at(i) == ',')

break;

}

//extract the sub string

string out= str.substr(start_index, i-start_index);

return out;

}

//splits the comma separted string as individual strings

//and returns the number of individual strings

int split(string str, string a[], int max_size)

{

int i, j;

int start_index = 0;

//search for commas in the given string

for (i = 0,j=0;i < str.length();i++)

{

//if comma is identified or end of the string is identified

//, then get a strig that starts at start_index using next string

if (str.at(i) == ',' ||i==str.length()-1)

{

//save each string into an array of strings

a[j] = nextString(str, start_index);

//update the next string starting postion(starts after comma)

start_index = i + 1;

j++;

}

}

return j;

Explanation:

Please see attachments

7 0
3 years ago
Other questions:
  • What are some ways in which reading and writing have changed in our newly networked world
    10·1 answer
  • Write a program FindDuplicate.java that reads n integer arguments from the command line into an integer array of length n, where
    11·1 answer
  • Before donating a computer you should use a program to wipe the hard disk to remove all of its data
    12·2 answers
  • Narrow margins are helpful for which task?
    6·1 answer
  • Kelly is a college sophomore majoring in computer science. She is interested in gaining exposure to the most useful and current
    14·1 answer
  • Of the people working in concert with security teams to ensure data quality and protection, the head of information management i
    5·1 answer
  • Any looping construct can be nested inside another loop is known as
    11·1 answer
  • Which of the following lines of code would reduce the player’s gold by 100 coins?
    14·1 answer
  • The database cannot be migrated to a different engine because sql server features are used in the application’s net code. The co
    12·1 answer
  • As data travels further over a wavelength or frequency, what goes down?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!