Create an array of objects from the provided code

Assignment Help C/C++ Programming
Reference no: EM13164902

Create an array of objects from the provided code and run a for loop to assign strings and numbers. In this assignment, I will need to see the main function. Make sure there is a default constructor.

Second part of assignment

Add to the class definition: get function, isEqual function, modify the set function so that only zero or positive numbers equal to or less than 1.0 are allowed for the interest rate, zero otherwise. The get function should use reference parameters like in the clockType class from the textbook (and in the example code described in class.

#include<iostream>

using namespace std;

class account{

private:

string name;

double balance, rate;

public:

account(){

name = "Default";

 

balance = 10000;

 

rate = 5.02;

 

}

 

account(string n, double b, double r){

name = n;

balance = b;

rate = r;

}

void display(){

cout << "Name: " << name << ", Balance: " << balance << ", Rate = " << rate << "\n";

}

 

};

 

int main(){

account num1("Derp", 22555, 9.95);

num1.display();

account num2("Derpina", 5520, 6.75);

num2.display();

}

Reference no: EM13164902

Questions Cloud

Write a program using an array that will store : Using java programing : Write a program using an array that will store input data. Prompt the user for and read 6 numbers between 70 and 90. Verify the numbers should be greater than 70 and less than 90. If the number is less than
What is mass in grams of the liquid propylene gylcol : what is the mass in grams of 30.0 mL of the liquid propylene gylcol, a moisturizing agent for foods, which has a density 1.036 g/mL at 25 degree Celsius.
State what by product might have formed : how might the addition of water helped convert this by product into the desired product?
What is the key value of the 4th index : What is the key value of the 4th index record on the top level, assuming each index record points to the record with the highest key value in a block of the next level down?
Create an array of objects from the provided code : Create an array of objects from the provided code and run a for loop to assign strings and numbers. In this assignment, I will need to see the main function. Make sure there is a default constructor.
How many grams of the element nickel are contained : How many grams of the element nickel are contained in 10.0 g of a 10.2 wt % solution of nickel sulfate hexahydrate, NiSO4 . 6H2O (FM 262.85)?
Creates three arrays of type double : Write a C# program that creates three arrays of type double. Using a loop, prompt the user to input 10 initial values for each of two arrays (for a total of 20 values).
Create a document describing the business : Created a document describing the business and identifying the problems being experienced by the assignment case study company, Farmers Friend.
When merge sorting you could recursively : Suppose when merge sorting you could recursively sort four sub-lists instead of two and still merge them all in linear time. Give the recurrence relation that describes this.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Binary tree, print right view of it

Given a Binary Tree, print Right view of it. Right view of a Binary Tree is set of nodes visible when tree is visited from Right side.

  Structs in an array of employee data.

Below is the instructions of my C++ Lab. The program must build in Microsoft Visual C++. Please use headers so the program will compile

  Use structures to create c program to compute student record

Explain the following and give their suitable syntax. A pointer. Use structures to create C program to compute and store student records of class.

  Create huffman codes

Write a C++ program to create Huffman codes. Program input is a file called freq.txt (make up your own file for testing) that contains data on the characters in some cleartext file in the form of each character's non-zero frequency of occurrence i..

  We wish to process survey results

Suppose we wish to process survey results that are stored in a file. This exercise requires twoseparate programs. First, create a program that prompts the user for survey responses and outputseach response to a file

  Develop a simple poker game

Develop a simple poker game

  Program to translates letter grade into number grade

In C++ (should be able to compile in Visual Studio 2010): Write a program to translates letter grade into number grade. Letter grades are A,B,C,D and F, possibly followed by a + or -.

  Display the array, the average and the number of days above

Write a program that stores the daily temperatures for the month of April in an array name dailytemp. Calculate the average temperature for the month and the count the number of days that the daily temperature was above the average.

  Pointer variables to demonstrate shallow and deep copy

Using C++, write a program that uses pointer variables to demonstrate shallow and deep copy. The program should give the user the choice to do the following:

  Build a definition for a class that stores data

Using C++ language, build a definition for a class that stores data about a two dimensional vector. The class has to have mutators and accessors to get and set the x and y values. Make x and y integers. Then overload the operator * so that it retu..

  Write a program that contains a main function

Write a program that contains a main function and three other functions that will return various attribute information about an array of floating point

  Write a program in c of fibonacci series

Write a program in c of fibonaci series with and without using fibo func, both

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd