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
Anna71 [15]
3 years ago
11

Write a program having a concrete subclass that inherits three abstract methods from a superclass. Provide the following three i

mplementations in the subclass corresponding to the abstract methods in the superclass:
1. Check for uppercase characters in a string, and return true or false' depending on if any are found.
2. Convert all of the lower case characters to uppercase in the input string, and return the result.
3. Convert the input string to integer and add 10, output the result to the console.
Create an appropriate class having a main method to test the above setup.
Computers and Technology
1 answer:
hammer [34]3 years ago
3 0

Answer:

C++

Explanation:

using namespace std;

class AbstractClass {

public:  

   virtual bool checkUpperCase(string inputString);

   virtual string lowerToUppercase(string inputString);

   virtual void stringToInt(string inputString);

};

class ConcreteClass: public AbstractClass {

public:

   bool checkUpperCase(string inputString) {

       bool isUpper = false;

       for (int i=0; i < strlen(inputString);  i++) {

           if (isupper(inputString[i])) {

               isUpper = true;

               break;

           }

       return isUpper;

      }

   string lowerToUppercase(string inputString) {

       for (int i=0; i < strlen(inputString);  i++) {

           putchar(toupper(inputString[i]));

       }

       return inputString;

   }

   void stringToInt(string inputString) {

       int convertedInteger = stoi(inputString);

       convertedInteger+=10;

       cout<<convertedInteger<<endl;

   }

};

int main() {

   ConcreteClass cc;

   return 0;

}

You might be interested in
Yahoo Messenger is an example of a/an __________ service on the Internet.
barxatty [35]

Answer:

Yahoo Messenger is an example of a service on the Internet.

7 0
3 years ago
Read 2 more answers
Which keyboard shortcut can you use to access the go to feature, which will allow you to move quickly to another location in the
I am Lyosha [343]

The keyboard shortcut can you use to access the go to feature, which will allow you to move quickly to another location in the document  is  Ctrl+G or F5.

<h3>What is a keyboard shortcut?</h3>

Keyboard shortcuts are known to be keys or a set of combination of keys that a person can press on one's keyboard to carry out a specified tasks.

By using keyboard shortcuts , one is often often faster than using a mouse  and  to see the option you are looking for, you have to press Ctrl+G or F5.

Learn more about keyboard shortcut  from

brainly.com/question/12531147

8 0
2 years ago
Given two complex numbers, find the sum of the complex numbers using operator overloading.Write an operator overloading function
Inessa05 [86]

Answer:

I am writing the program in C++ programming language.  

#include<iostream>  // to use input output functions

using namespace std;   // to identify objects like cin cout

class ProblemSolution {  //class name

private:  

// private data members that only be accessed within ProblemSolution class

int real, imag;

 // private variables for real and imaginary part of complex numbers

public:  

// constructor ProblemSolution() to initialize values of real and imaginary numbers to 0. r is for real part and i for imaginary part of complex number

ProblemSolution(int r = 0, int i =0) {  

real = r; imag = i; }  

/* print() method that displays real and imaginary part in output of the sum of complex numbers */

void print(){  

//prints real and imaginary part of complex number with a space between //them

cout<<real<<" "<<imag;}  

// computes the sum of complex numbers using operator overloading

ProblemSolution operator + (ProblemSolution const &P){  //pass by ref

          ProblemSolution sum;  // object of ProblemSolution

          sum.real = real + P.real;  // adds the real part of the  complex nos.

          sum.imag = imag + P.imag;  //adds imaginary parts of  complex nos.

//returns the resulting object

          return sum;       }  //returns the sum of complex numbers

};   //end of the class ProblemSolution

int main(){    //start of the main() function body

int real,imag;  //declare variables for real and imaginary part of complex nos

//reads values of real and imaginary part of first input complex no.1

cin>>real>>imag;  

//creates object problemSolution1 for first complex number

ProblemSolution problemSolution1(real, imag);  //creates object

//reads values of real and imaginary part of first input complex no.2

cin>>real>>imag;

//creates object problemSolution2 for second complex number

ProblemSolution problemSolution2(real,imag);

//creates object problemSolution2 to store the addition of two complex nos.

ProblemSolution problemSolution3 = problemSolution1 + problemSolution2;

problemSolution3.print();} //calls print() method to display the result of the //sum with real and imaginary part of the sum displayed with a space

Explanation:

The program is well explained in the comments mentioned with each statement of the program. The program has a class named ProblemSolution which has two data members real and imag to hold the values for the real and imaginary parts of the complex number. A default constructor ProblemSolution() which initializes an the objects for complex numbers 1 and 2 automatically when they are created.

ProblemSolution operator + (ProblemSolution const &P) is the operator overloading function. This performs the overloading of a binary operator + operating on two operands. This is used here to add two complex numbers.  In order to use a binary operator one of the operands should be passed as argument to the operator function. Here one argument const &P is passed. This is call by reference. Object sum is created to add the two complex numbers with real and imaginary parts and then the resulting object which is the sum of these two complex numbers is returned.  

In the main() method, three objects of type ProblemSolution are created and user is prompted to enter real and imaginary parts for two complex numbers. These are stored in objects problemSolution1 and problemSolution2.  Then statement ProblemSolution problemSolution3 = problemSolution1 + problemSolution2;  creates another object problemSolution3 to hold the result of the addition. When this statement is executed it invokes the operator function ProblemSolution operator + (ProblemSolution const &P). This function returns the resultant complex number (object) to main() function and print() function is called which is used to display the output of the addition.

4 0
4 years ago
Everyone within a company needs to be aware of what data can do to improve business processes and how to make it happen. Which c
OLga [1]

The concept that is been referred to in the statement above is known as data literacy.

<h3>What is data literacy?</h3>

The term data literacy is known to be man's  ability to be able to read data, compose and share data. The  understanding of data sources and how it works it all about  data literacy.

Conclusively, when everyone in a firm are said to be data literate, There will be a lot of improvement in business processes of any firm.

Learn more about data literacy from

brainly.com/question/16514379

7 0
2 years ago
It can be useful to have a mentor because they will help you
MArishka [77]
Get comfortable quickly
3 0
4 years ago
Read 2 more answers
Other questions:
  • WILL MARK BRAILIEST IF ANSWERED FAST!!!
    8·1 answer
  • Write a Tip Calculator in code in VMware Fusion
    13·1 answer
  • Tiny charts embedded in cells that show a visual trend alongside the data are called __________.
    10·1 answer
  • Using ______, a smartphone can connect to an automobile audio/control system
    6·1 answer
  • What does the e in email stand for
    8·2 answers
  • When is a wrecker considered to be an emergency vehicle?
    12·1 answer
  • Which software would you use to create a print design?
    8·2 answers
  • Someone pleaseee answer my last question i just posted ;-;
    6·2 answers
  • Name the written test a potential driver must pass and list the minimum required score to earn a learner’s license.
    8·2 answers
  • What is word processing program,Give 3 types of word processing program​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!