Learn C++ | Sololearn X Member Initializers G Problem 18°C Cloudy X Member Initializers 144Hz REFRESH RATE https://www.sololearn.com/learning/1051 You are making a program to store TVs with their width and height. The given program declares a TV class with height and width members, an area() method, as well as a constructor that initializes the members of the class. Complete the program by taking 2 integers as input, create a TV object by passing them to the constructor, and call the area() method. Note, that the constructor needs 2 integer values.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Solve the question in the first picture. Put it in the 2nd picture code

Learn C++ | Sololearn
Cn
X Member Initializers
Problem
Member Initializers
18°C
Cloudy
x +
You are making a program to store TVs with their width and height.
The given program declares a TV class with height and width members, an area()
method, as well as a constructor that initializes the members of the class.
Complete the program by taking 2 integers as input, create a TV object by passing
them to the constructor, and call the area() method.
144Hz
https://www.sololearn.com/learning/1051
REFRESH RATE
Note, that the constructor needs 2 integer values.
O
FO
DE
Transcribed Image Text:Learn C++ | Sololearn Cn X Member Initializers Problem Member Initializers 18°C Cloudy x + You are making a program to store TVs with their width and height. The given program declares a TV class with height and width members, an area() method, as well as a constructor that initializes the members of the class. Complete the program by taking 2 integers as input, create a TV object by passing them to the constructor, and call the area() method. 144Hz https://www.sololearn.com/learning/1051 REFRESH RATE Note, that the constructor needs 2 integer values. O FO DE
1
2
3
4
5
6
7
1600-
10
11
12
13
14
15
16
17
18
19
DEV
#include <iostream>
using namespace std;
CH
class TV {
public:
C
}
private:
};
int main() {
EPIC
GAMES
TV(int h, int w): height(h), width(w) {};
void area() {
cout <<height*width;
int height;
int width;
X
O
Need help?
Col
See So
ENG
US
Transcribed Image Text:1 2 3 4 5 6 7 1600- 10 11 12 13 14 15 16 17 18 19 DEV #include <iostream> using namespace std; CH class TV { public: C } private: }; int main() { EPIC GAMES TV(int h, int w): height(h), width(w) {}; void area() { cout <<height*width; int height; int width; X O Need help? Col See So ENG US
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Data members
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education