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

  Write a program to make the ssds function

Write a program to make the SSDs function as a MM:SS real-time clock. Hint: You must not use a single delay routine for the one second delay because that will not allow for persistence of vision. The displays need to be constantly refreshed during ev..

  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 code to compute and build a table of reynold

Write a program code to compute and build a table of Reynolds numbers at flow velocities varying from 100 to 1000 ft/sec (at increments of 100)

  Create a website that would allow users to enter and submit

Create a Website that would allow users to enter and submit survey

  Design for storing the maze layout

Design and implement a C++ program for maze layout

  Writing a program that creates a linked list

Writing a program that creates a linked list from 100 randomly generated numbers and sorts the using a heap. One heap in ascending order and one heap in descending order. Then displays the original linked list and both sorted lists.

  Print each employee''s identification number

1) in a program you need to store the identification numbers of 10 employees (as ints) and their weekly gross pay (as doubles) A) Define two arrays that may be used in parallel to store the 10 employee indentificcation numbers and gross pay amounts B..

  Three or more dimensions

What kind of program, or problem, might necessitate arrays of three or more dimensions?

  Multidimensional arrays

multidimensional arrays to life, let's consider a specific example: How can you visualize a 4-dimensional array? How can you give meaning to each dimension this array has? What kind of application would such an array be useful for?

  Implement a standard sorted linked list class

Write C++ Program:Implement a standard SORTED linked list class. Be sure to include constructor/copy constructor, destructor, and assignment operator overload.

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Write a program that finds the equivalent series

Write a program that finds the equivalent series and parallel resistance for a collection of resistor values. Your program should scan first the number of resistors and then the resistor values. Then compute the equivalent series resistance for all r..

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