Question: could you help me these 5 questions since I do not know how to do this part in C++. The code used for question 2

 could you help me these 5 questions since I do not

know how to do this part in C++. The code used for

question 2 at below. ------------------------------------------------ /* * Lab6_2.h * * Created on:

Sep 11, 2017 * NAME: * STUDENT No: */ #include #include class

could you help me these 5 questions since I do not know how to do this part in C++.

The code used for question 2 at below.

------------------------------------------------

/*

* Lab6_2.h

*

* Created on: Sep 11, 2017

* NAME:

* STUDENT No:

*/

#include

#include

class chk{

std::string name;

int acountNo;

float minimum_banlance;

float over_limit_charge;

float balance;

public:

chk(std::string);

void display();

void deposit(float m);

void withdraw(float m);

};

---------------------------------------

/*

* Lab6_2.cpp

*

*

* NAME:

* STUDENT No:

*/

#include "Lab6_2.h"

#include

#include

using namespace std;

chk::chk(string n){

name = n;

minimum_banlance = 1000;

over_limit_charge = 5;

balance = 0;

srand(time(NULL));

acountNo = rand();

}

void chk::display(){

cout

cout

cout

}

void chk::deposit(float m){

balance += m;

}

void chk::withdraw(float m){

if (balance

cout

return;

}

balance -= m;

if (balance

balance -= over_limit_charge;

}

------------------------------------------------------

/*

* Lab6_2_test.cpp

* NANE:

* STUDENT NUMBER:

*/

#include "Lab6_2.h"

#include

using namespace std;

int main(){

// create an acount

chk chk1("John Jone");

// input and select the menu

while(1){

// build the menu

int menu;

cout

cout

cout

cout

cout

cin >> menu;

switch (menu){

case 0:return 0;

case 1:

//display the balance

chk1.display();

break;

case 2:

float m;

cout

cin >> m;

chk1.deposit(m);

break;

case 3:

cout

cin >> m;

chk1.withdraw(m);

break;

}

}

}

//#endif /* LAB4_2_H_ */

. X ./C Chegg Study Guided Solutx Y Assignment x Assignments (3).pdf x structfttypedef structe ? C O file:///Users/Jason/Downloads/Assignment6%20(3).pdf # ---D750... HAFLE SE M E RIT... Computer Science... . Learn HTML: Eleme... w W3Schools Online... C CHIC+++49(struct). Ex C++ atof() QN9 C++ Language - C... C++ Environment S... vironment S... >> ** CSCI200A- Assignment 6 Const and in-lines Q1 const Write a program in a single cpp file that contains a function main(), name the file const.cpp. In the main function: 1) declare a const integer variable d and try to initialize it at the second line see what is the error. Comment this line in order to proceed to the rest steps without compilation error. 2) declare a const integer variable c and initialize it to 0; 3) declare a pointer ptr that points to c; print the dereferencing of ptr. 4) try to increase the content of deference of ptr, e.g. (*ptr)++, see what is the error and explain. 5) declare a constant integer array arr initialized to {10, 20,30,40,50); let ptr point to arr and print *ptr and *ptr+1). 6) declare a constant pointer cptr which points to constant integer arr. 7) try to let cptr point to constant c, see what is the error. Q2 const in class Based on lab 6, change the accountNo to constant member variable and change constructors

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!