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
babunello [35]
3 years ago
13

Analyze the following code:

Computers and Technology
1 answer:
user100 [1]3 years ago
5 0

Answer:

Constructor issue

Explanation:

When you look at the Class A, the constructor takes one argument as a parameter, a String.

A(String newS) {

s = newS;

}

However, in the main, the constructor does not take any argument as a parameter.

A a = new A();

That's why the code does not compile.

You might be interested in
Time Conversion C++: Given a time in -hour AM/PM format, convert it to military (24-hour) time.
mixer [17]

Answer:

Code in C++::

#include<bits/stdc++.h>

#include<iostream>

#include<string>

#include<sstream>

using namespace std;

string timeConversion(string s){

/**

* Following two strings are declared named d and c respectively.

* String c will be storing the converted format time and we will return

* c as the answer.

*/

string d,c="";

/**

* String d stores "PM" or "AM"

*/

d=s.substr(8,2);

/**

* An integer named hr is declared below and it stores

* the hh part of string hh:mm:ssPM in integer format.

*/

int hr=atoi(s.substr(0,2).c_str());

if(hr==12 && d=="AM"){

/**

* Now suppose hr is 12 and its AM then we know that it's

* midnight and so hr must be 0.

*/

hr=0;

}

if(d=="PM" && hr!=12){

/**

* Suppose d is "PM" and hr is not 12 then we add 12 into hr.

*/

hr+=12;

}

if(hr<10){

/**

* Now suppose hr is less then 10 then we know that in final answer

* if hr is 7 then we need "07".

* So if hr < 10 then we add extra 0 at start of c string.

*/

c+="0";

}

/**

* Now we convert hr back to string using stringstream.

* A variable named hour is declared and we convert hr to string as follows.

*/

stringstream hour;

hour<<hr;

/**

* Finally we update the c string as required and return it at the end.

*/

c=c+hour.str()+s.substr(2,6);

return c;

}

int main(){

/**

* A string named s is declared and using cin we scan the string.

*/

string s;

cin>>s;

/**

* Below we call the function and pass string s as parameter.

* Whatever function returns, it is printed.

*/

cout<<timeConversion(s)<<endl;

return 0;

}

Explanation:

see thees attached

8 0
3 years ago
Use the {blank} to view your presentation the way an audience will see it.
steposvetlana [31]
I would believe it would be A. Slide Show Button
4 0
3 years ago
Read 2 more answers
What can a user do using the Contact Group dialog box? Check all that apply.
RSB [31]

Answer:

1,2,4,5,7

Explanation:

Had the question

3 0
3 years ago
Read 2 more answers
To add artwork to a slide, the slide must contain a placeholder. <br> a. True <br> b. False
valina [46]
The answer is True.  To add artwork to a slide, the slide must contain a placeholder. <span>Once </span>artwork<span> is inserted into a </span>placeholder<span>, it can be moved around the </span>slide<span>.</span>
5 0
4 years ago
As a highly flexible structure, __________ can be quickly configured to adapt as required due to changes.
tresset_1 [31]

As a highly flexible structure, a <u>matrix organization</u> can be quickly configured to adapt as required due to changes.

<h3>What is a matrix organizational structure?</h3>

A matrix organizational structure can be defined as a type of work structure where reporting relationships between employees and the top executive (employers) are set up as a matrix rather than the conventional hierarchy approach, which makes it highly flexible and adaptable to subsequent changes.

<h3>The types of matrix organizational structure.</h3>

In business management, there are three types of matrix organizational structure and these include:

  • Weak matrix structure.
  • Balanced matrix structure.
  • Strong matrix structure.

Read more on matrix organization here: brainly.com/question/7437866

7 0
3 years ago
Other questions:
  • The source ip address is 164.109.28.3 subnet mask of 255.255.128.0 network address is
    7·1 answer
  • In the INSERT statement that follows, assume that all of the table and column names are spelled correctly, that none of the colu
    9·1 answer
  • Which of these computers was marketed as a computer/game machine?
    15·2 answers
  • What is the output <br>this is a computer science question ​
    8·1 answer
  • The first thing you must consider in any type of communication is ______.
    9·2 answers
  • Digital Subscriber Line (DSL) is the only Internet connection option available for a small office in the middle of nowhere. Whic
    15·1 answer
  • (TCO 1) You want to find the IP address of an interface. How can you quickly do this?
    7·1 answer
  • Explain the significance of the loss of direct, hands-on access to business data that end users experienced with the advent of c
    14·1 answer
  • Power point is hardware or software​
    12·2 answers
  • While storms could be a cause, power______ are more likely to be caused by disturbances from high-demand equipment in a home or
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!