I have a Loan class that in its printPayment method, it prints the amortization table of a loan for a hw assignment. We are also to implement a print first payment method, and a print last payment method. Since my calculation is done in the printPayment method, I didn't know how I could get the value in the first or last iteration of t...
I have one class that declares an enumeration type as:
public enum HOME_LOAN_TERMS {FIFTEEN_YEAR, THIRTY_YEAR};
Is this type usable in another class? I'm basically trying to complete a homework assignment where we have two types of loans, and one loanManager class. When I try to use the HOME_LOAN_TERMS.THIRTY_YEAR in my loanManager ...
Greetings all,
I've written software in the past that uses a stack to check for balanced equations, but now I'm asked to write a similar algorithm recursively to check for properly nested brackets and parenthesis.
Good examples: () [] ()
([]()[])
Bad examples: ( (] ([)]
Suppose my function is called: isBalanced.
Should e...
Consider the DUPoint class, whose declaration appears below. Assume this code appears in a file named DUPoint.h:
#include <string>
class DUPoint {
public:
DUPoint (int x, int y);
int getX () const;
int getY () const;
void setX (int x);
void setY (int y);
void print();
private:
int x_;
int y_; ...
Hey guys, I have a CS exam tomorrow. Just want to get a few questions cleared up. Thanks a lot, and I really appreciate the help.
Que 1.
What are parallel vectors?
Vectors of the same length that contain data that is meant to be processed together
Vectors that are all of the same data type
Vectors that are of the same length
Any vecto...
in this code i don't understand why teacher used sometimes +value, - value;
/******************************************/
// function void returnSquares(POINT point, int value)
void returnSquares(POINT point, int value) {
SQUARE tabSquares[4]; // table of squares that we are creating
int i;
// getting points of 4 squar...
In order for a school project i need to create the following situation within one mysql query.
The situation is as such, that a child's tags and a parent's tags need to be combined into one, and compared to a site's tags, depending on a few extra simple equals to lines.
For this to happen I only see the option that the result of a subq...
I have got a table which contains 5 column and query requirements:
update row no 8 (or id=8) set its column 2, column 3's value
from id 9th column 2, column 3 value.
means all value of column 2, 3 should be shifted to column 2, 3 of upper row (start from row no 8) and value of last row's 2, 3 will be null
For example, wit...
I'm working on a program for class that involves solving the Chinese Postman problem. Our assignment only requires us to write a program to solve it for a hard-coded graph but I'm attempting to solve it for the general case on my own.
The part that is giving me trouble is generating the partitions of pairings for the odd vertices.
For...
This is how the program looks and i need to make all integers with different name. Like x,x1,x2 and so on...
#include <cstdlib>
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ifstream iFile("input.txt"); // input.txt has integers, one per line
while (true) {
int x;
iFile >> x;
if( i...
You are required to write a maximum of two instructions in assembly to do the following:
Clear bits 0 and 7 of register AL, i.e. make them 0
Set bits 3 and 4 of register AL, i.e. make them 1.
Complement bits 1 and 5 of register AL.
Keep all other bits in the register AL as is without changing their values.
...
Hello! I have to work with an application in C++ similar to a phone book: the class Agenda with an STL list of Contacts.Regarding the contacts hierarchy,there is a base-class named Contact(an abstract one),and the derived classes Friend and Acquaintance(the types of contact).
These classes have,for instance, a virtual method called...
I have two basic Cpp tasks, but still I have problems with them. First is to write functions mul1,div1,sub1,sum1, taking ints as arguments and returning ints. Then I need to create pointers ptrFun1 and ptrFun2 to functions mul1 and sum1, and print results of using them. Problem starts with defining those pointers. I thought I was doing i...
My task is to create function funCall taking four arguments :
pointer for 2d array of ints that stores pairs of numbers
variable int maintaining number of numbers in 2d array
pointer for table of pointers to functions
int variable storing info about number of pointers to functions
I was thinking about something like this :
typedef i...
I need to to write a method that is called like printTriangle(5);. We need to create an iterative method and a recursive method (without ANY iteration). The output needs to look like this:
*
**
***
****
*****
This code works with the iterative but I can't adapt it to be recursive.
public void printTriangle (int count) {
int line ...
Hi,
For an academic assignment, I need to make a regular expression to match a word with the following specifications:
Word length >= 1 and <= 8
Contains letters, digits, and underscore
First digit can only be a letter
Word is not A,X,S,T or PC,SW
I tried this regex but can't continue (My big problem is to make the word not equal to...
This is an ATM style program, but currently it doesn't do exactly what I need it to do...
I need to get the current balance, and when money is transferred from either checking or savings, it should add it to checking and subtract it from savings. which is does, but not correctly...
Input example
-=[ Funds Transfer ]=-
-=[ Savings to C...
Hello, I'm trying to convert some c code to assmebly, and I need some help.
char encode(char plain){
__asm{
mov eax, plain
add eax, 2
ret
}
//C code
/*
char code;
code = plain+2;
return code;*/
}
First problem is that visual studio complains that the register size doesn't matc...
For a class assignment, I have to use two stacks in C++ to make an equation to be converted to its left to right equivalent: 2+4*(3+4*8) --> 35*4+2 --> 142
Here is the main code:
#include <iostream>
#include <cstring>
#include "ctStack.h"
using namespace std;
int main (int argc, char * const argv[]) {
string expression = "2+4*2";
...
Well, I'm trying to create a newsletter, that will send emails to users in a database. The newsletter itself would draw "events" and other activities from a database. Whats the best way to take that list, and put them in an email? I was thinking about putting them into an html page, then sending an html email, but not all emails support...