Professional Documents
Culture Documents
QUESTION 3 (30 Marks) Construct A C++ Program Usin...
QUESTION 3 (30 Marks) Construct A C++ Program Usin...
QUESTION 3 (30 Marks) Construct A C++ Program Usin...
home / study / engineering / computer science / computer science questions and answers / question 3 [30 marks] construct a c++ program using class…
Question: QUESTION 3 [30 Marks] Construct a C++ program using class th… Post a question
Answers from our experts for your tough
homework questions
(1 bookmark)
#1 Malaysia:
Enter question W Air Freshener
W Fragrance Open
Continue to post
20 questions remaining
#1 Malaysia: W
Air Freshener
My Textbook Solutions
Expert Answer
Code
#include<bits/stdc++.h>
using namespace std;
class circuit{
public:
int R1;
int R2;
int R3;
void current(){
int V=30;
//calculating and printong the current through each resistors
cout<<"Curent through R1 is "<<(V*1.0)/R1<<"A, through R2 is "<<(V*1.0)/R2<<"A, and through R3 is "
<<(V*1.0)/R3<<"A"<<endl;
}
};
int main(){
int R1,R2,R3;
cout<<"Enter the values of R1, R2 and R3: ";
cin>>R1>>R2>>R3;//input resistors value
circuit c(R1,R2,R3); //creating an object of circuit class i.e c
c.current(); //call the current function of circuit class
}
Output-
Comments
Anonymous posted 2 weeks ago
Leave a comment
Q: Question 1 [40 Points]: Read carefully and then answer the following questions Fatima works as a Quality Assurance
Engineer at a large electronics company. She is responsible for the nal testing of her company's servers and is part of a
team which decides when new products will be shipped to distributors for sale. Fatima's company has a contract with
another company which makes...
Q: QUESTION 3 [30 Marks] Construct a C++ program using class that has data member and member function to compute
the current through each resistor for circuit shown in Figure 2. R3 WWW R2 www R1 WW V Figure 2 Take the voltage, V,
equal to 30 volts. Use R1 = 10, 20, and 30 N; R2 = 40, 60, and 80 ; and R3 = 100, 120, and 130 N. (30 Marks)
A: See answer
Show more
COMPANY LEGAL & POLICIES CHEGG PRODUCTS AND SERVICES CHEGG NETWORK CUSTOMER SERVICE
About Chegg Advertising Choices Cheap Textbooks Chegg Math Solver EasyBib Customer Service
Chegg For Good Cookie Notice Chegg Coupon Mobile Apps Internships.com Give Us Feedback
College Marketing General Policies Chegg Play Sell Textbooks Thinkful Manage Subscription
Corporate Development Intellectual Property Rights Chegg Study Help Solutions Manual
Investor Relations Terms of Use College Textbooks Study 101
Jobs Global Privacy Policy eTextbooks Textbook Rental
Join Our Affiliate Program DO NOT SELL MY INFO Flashcards Used Textbooks
Media Center Honor Code Learn Digital Access Codes
Site Map Honor Shield Uversity Chegg Life
Chegg Writing