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
Nataliya [291]
3 years ago
11

Create a file account.cpp containing a Bank Account Class.

Computers and Technology
1 answer:
Daniel [21]3 years ago
3 0

Answer:

#include <iostream>

using namespace std;

class BankAccount {

  string name = name;

  double balance = balance;

  BankAccount( string name, double balance ) {

    string name = name;

    double balance = balance;

     return 0;

  }

  string getName( ){

     return name;

  }

  double getbalance( ) {

     return balance;

  void setName( string username){

     name = username;

  }

  void setbalance( double newBalance){

     balance = newBalance;

  }

int main( ) {

  BankAccount user1(John, 0.0);

  BankAccount user2(Jane, 0.0);

  user1.setbalance( 2300.00)

  user2.setbalance( 4300.00)

  cout << user1.getname() << user1.getbalance();

  cout << user1.getname() << user1.getbalance();

}

Explanation:

The C source code above using a class to create a data structure of a bank account user name and balance. The attribute name and balance are private to the class and can be retrieved and modified through the get and set methods.

You might be interested in
Subscribe to my you tube channel to get all your questions answered
vredina [299]

kaaaaaaaaaaaaaaaaa

aaa

4 0
3 years ago
What item on a business card is generally the most prominent?
andre [41]
All of them are correct


7 0
3 years ago
Read 2 more answers
Online Book Merchants offers premium customers 1 free book with every purchase of 5 or more books and offers 2 free books with e
andrey2020 [161]

Answer:

This question has two parts, first part is about programming about a Player class and second for reading string from user and decide how many time duck string entered by user and terminate if user press goose string.

The explanation of both program (executable code) is given below in explanation section.

Explanation:

//Program 1

#include <iostream>

using namespace std;

int main()

{

 bool isPremiumCustomer;

 int nbooksPurchased;

 int totalBookPurchasedWithOffer;

// bool cutomerType;

 int freeBooks;

 cout<<"Press 1 for Premium Customer and 0 for regular Customer";

 cin>>isPremiumCustomer;

 cout<<"How many books you purchased ";

 cin>>nbooksPurchased;

 

 

switch(isPremiumCustomer)// what type of customer is  

{

case 1://if customer is premium

 if (nbooksPurchased >= 5&&nbooksPurchased<8)// purchase book greater between 5 and 8

  {

   freeBooks=1;//offer free book

   totalBookPurchasedWithOffer=nbooksPurchased+freeBooks;//total number of book including free book

   

   cout<<"You purchased total book with offer ";//show total books

   cout<<totalBookPurchasedWithOffer;

  }

   

  else if (nbooksPurchased >= 8)//if premium customer purchase more than 8 book

    {

    freeBooks=2;//offer two free book

    totalBookPurchasedWithOffer=nbooksPurchased+freeBooks;//total number of book including free book

    cout<<"You purchased total book with offer ";

    cout<<totalBookPurchasedWithOffer;//show total books

    }

  else{

   cout<<"You purchased total book with no offer ";

    cout<<nbooksPurchased;

   }

  break;

case 0:// if customer is regular customer

 if (nbooksPurchased >= 7&&nbooksPurchased<12)//and purchase book between 7 and 12

  {

   freeBooks=1;// offer 1 free book

   totalBookPurchasedWithOffer=nbooksPurchased+freeBooks;

   cout<<"You purchased total book with offer ";

   cout<<totalBookPurchasedWithOffer;

  }

   

  else if (nbooksPurchased >= 12)//if purchase 12 or more than 12 book

    {

    freeBooks=2;//offer two free book

    totalBookPurchasedWithOffer=nbooksPurchased+freeBooks;

    cout<<"You purchased total book with offer ";

    cout<<totalBookPurchasedWithOffer;

    }

 else{

  cout<<"You purchased total book with no offer ";

  cout<<nbooksPurchased;

  }

  break;

 

}

 

 

 

return 0;// terminate the program

 

}

/* program 1 has ended

and program 2 is started from here

#######################################################

*/

#include <iostream>

using namespace std;

int main()

{

string readstring;// take input string from user to enter either "goose" or "duck"

int count=0;//count the number of "duck"

while(readstring!="goose")//run loop, until user do not enter string  

{

 cout<<"Enter the string either goose or duck ";// prompt user to enter the string

 cin>> readstring;// read string from user

 if (readstring=="duck")//if string equal to "duck"

 {

  count=count+1;//count number of duck string enter by user

   

 }

}//exit/terminate the loop, if user enter the goose string

cout<< " Number of duck that were read " ;// show how many duck string entered by user

cout<<count;

return 0;// terminate the program

 

}

6 0
3 years ago
How much are the prelab, inlab, and postlab parts worth?prelab:% inlab:%postlab%
Semmy [17]

Each lab consists of a PreLab, InLab, and a PostLab. PreLabs are worth 20%, InLab 50%, and PostLabs 30% of the final lab grade. the fifth submission is worth 40%.

<h3>What is prelab?</h3>
  • Pre-lab assignments are tasks or homework that students complete before arriving in class for the lab period.
  • Pre-lab assignments motivate students to prepare for the lab and help them connect conceptual understanding with an experiment.
<h3>What is inlab?</h3>
  • With inLab CAD Software, you design digital dentures and partial frameworks as well as splints, impression trays, and telescopes.
<h3>What is postlab?</h3>
  • Postlab is a Mac app that lets you collaborate on Final Cut Pro X libraries and Premiere Pro projects.
  • Postlab enables editors to share files, track and save changes, and make sure no more than one person is working on the same library or project simultaneously.

To learn more about it, refer

to brainly.com/question/22654163

#SPJ4

5 0
1 year ago
Which is a correct explanation of first lines?
tatyana61 [14]

The correct explanation of the first line in poems is; Choice B; The first lines determine all of the poet's subsequent choices.

<h3>Meaning of poem</h3>

By literature definition, a poem is a piece of writing in which the words are chosen for their beauty and sound and are carefully arranged, often in short lines which rhyme.

To ensure that these short lines in poems rhyme, the first line serves as a template and consequently, determines all of the poet's subsequent choices.

Read more on poems and first line;

brainly.com/question/4343450

8 0
2 years ago
Other questions:
  • Which is the last step in conducting a url research
    11·1 answer
  • What is difference between RAM and ROM?
    13·1 answer
  • HELP PLEASE!!!!!!!!
    10·1 answer
  • What color does Sam obtain when he mixes white with a color? Sam is painting a landscape and needs to paint the sky light blue.
    9·2 answers
  • The commands available from a menu change depending upon what you are doing.<br> True<br> False
    11·2 answers
  • What is the name of the formal procedure scientists use to study the world around them?
    14·2 answers
  • What is one way to recognize whether an online source has been copyrighted? The source features the phrase “all rights reserved.
    6·2 answers
  • who thinks homework is anoyying? (freddy randomly started thinking scince he was the leader he caould start acting like a teache
    8·2 answers
  • Which components are involved with input? Output? Processing? Storage?
    15·2 answers
  • Most portable devices, and some computer monitors have a special steel bracket security slot built into the case, which can be u
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!