C/C++ :: Cash Register Program - Reinitializing Values With Subprograms

Dec 7, 2014

I'm trying to make a cash register program, but first I need to reinitialize ones, fives, tens, and twenties to their correct dollar amount. However, whenever I try to pass the user inputted values to the function that calculates the correct dollar amount, it just prints the same number.

Here's my code:
#include <iostream>
#include <string>
using namespace std;
//dollarAMT - recalculates the actual dollar amount
void dollarAMT(int ones, int fives, int tens, int twenties){

[Code] ....

View 1 Replies


ADVERTISEMENT

C++ :: Cash Register Program - Reinitializing Values With Subprograms

Dec 7, 2014

I'm trying to make a cash register program, but first I need to reinitialize ones, fives, tens, and twenties to their correct dollar amount. However, whenever I try to pass the user inputted values to the function that calculates the correct dollar amount, it just prints the same number.

Here's my code:

#include <iostream>
#include <string>
using namespace std;
//dollarAMT - recalculates the actual dollar amount
void dollarAMT(int ones, int fives, int tens, int twenties){

[Code] ....

View 2 Replies View Related

C++ :: How To Read Pixels From X / Y Coordinate Using VGA Register Values

Aug 4, 2013

How to read pixels from an x,y coordinate using the VGA register values?

byte readVRAMdirect(VGA_Type *VGA, uint_32 start, uint_32 offset) //Used in 256 color mode!
{
if (!VGA->VRAM_size) return 0; //No size!
return VGA->VRAM[SAFEMOD((start*4)+offset,VGA->VRAM_size)]; //The full protected offset!

[code]....

getVRAMScanlineStart(VGA,y) gives the offset register multiplied by 2 (shl 1), multiplied with the current memory address size (byte, word or dword) multiplied by the scanline. 256-color mode is already working. GETBIT gives a bit #(0-7) of a specified byte.

writeVRAMplane & readVRAMplane are used by the CPU to write data to VRAM (address 0xA000:xxxx-0xBFFF:xxxx), determined by the memory read and write modes(working) and the odd/even, planar or chain4 enable mode (working).how to get the 16 color and interleaved shift mode working?

ZIP with screen captures: URL....

View 2 Replies View Related

C/C++ :: How To Use Register Selectively

Feb 15, 2013

I am looking for a way to create a virtual registry and force only certain programs to use this one? Or to create a virtual Registry but which i can shut down (this registry will be only used while i activate it)?

Or redirect all querys to another place in the registry I've seen similar issues. But there is no answer how to use the register selectively!

View 16 Replies View Related

Visual C++ :: How To Register ATL Exe COM

Apr 4, 2013

I created an EXE COM server with ATL.

and from the client (DLL COM with ATL) i want to create an instance of the EXE (CreateInstance(CLSID of the EXE)).

how do i register the exe so that i know the path to the com server.

View 2 Replies View Related

C :: Using File As Accumulator Register

Dec 4, 2013

I need to use a file as an accumulator of very large size.

I want to write one bit at a time. I have an iteration engine that applys so logic to either add 1, do nothing, or subtract 1 from the array, but it has to be much larger when dealing with multi-GB files.

So I either need to & the 8bit to 4K array value to a file or write it it one bit at a time.

But it is not that I want to write sequential bytes, I need the file to be written so it acts as accumulator.

I know its in front of my face, but I need to rethink this

View 1 Replies View Related

C++ :: Exceeded 32bit Register Value Exceeds 4 Bytes

May 28, 2014

My question, What happens when with the 32 bit register value exceeds 4 bytes while programming in c++? Im interested in encryption.

Im programming and doing some calculations. The hex value "0xFA062F2F" multiplied by "6D" sends it over "0x6A74A21703", which exceeds 32bit.

My problem is while programming in C++, I do some calculations such as above, and I get the hex value "0xC0000001" which should be "0x6A74A21703". I made sure that I use long long as my interger type.

How can I overcome this problem with programming.

View 3 Replies View Related

C++ :: Write A Program That Replaces Values In A Vector With Their Absolute Values

Dec 4, 2013

This is my code: [tag]

Code:
#include <iostream>
#include <string>
#include <cstring>
#include <vector>

using namespace std;

[Code] .....

View 4 Replies View Related

C :: How To Write A Program That Gives Few Default Values

Oct 11, 2014

I would like to write a program that gives you a few default values. Now you can keep these values by pressing the enter key or you can change them by just typing in new ones and confirm the new values by pressing the enter key again.

Thats as far as i got on my own but it doesn't really work. what i can do to fix this.

Code:

#include<stdio.h>
#include <conio.h>
int getInt(int min, int max);
int main () {
int a[3] = {3,4};
int b;
int code;

[Code]...

View 2 Replies View Related

C :: Program That Allow To Enter Certain Amount Of Values

Sep 29, 2014

How to write a code that will let me input how many variables I want.

Write a program that will enable you to enter a certain amount of values

Eg. 4

And then add the corresponding integers. Ex.

Choice: 4 12 34 56 78

The sum of the integers is: 180.

View 4 Replies View Related

C++ :: Program To Fill Grid With Values Between 1 And 100

Aug 27, 2014

Write a menu driven program that will fill grid with values between 1 and 100. Begin the program by declaring a array of type int. Then present the user with the following menu

Enter 1 to add
Enter 2 to edit
Enter 3 to delete
Enter 4 to search
Enter 5 to display
Enter 0 to Quit

Each item of the menu must be implemented as a function. The program should Only allow values between 1 and 100

Always ask the user to apply coordinates for the cell to be changed

Flag an error when try to delete or edit a cell with a zero (0)

Flag an error when try to add to a cell that is not blank

Display the complete and nicely formatted grid when option 5 is selected

View 2 Replies View Related

C/C++ :: Program To Read Values From A File?

Sep 18, 2014

I am trying to get my program to calculate what point goes in what quadrant using a file. But msy program is not reading the values from the file and also it is not running so im not sure what's wrong with it.

//This program uses a fstream object to write data that will read the values of a (x,y) point from a file.
//add the appropriate preprocessor
#include <fstream>
#include <iostream>

[Code].....

View 6 Replies View Related

C/C++ :: Why Program Is Not Putting Values In The Array

May 1, 2014

# include <stdio.h>;
int main (void){
float judges[6];
int degree;

[Code].....

View 5 Replies View Related

C/C++ :: A Program That Repeatedly Reads In Values?

Sep 26, 2014

I started to write a program that repeatedly reads in values for a,b and c and find the root of the polynomial

ax^2 + bx + c = 0

The program should print out for example:

two complex roots: root1 = -1.00000 + i*1.41421
root2 = -1.00000 - i*1.41421

My code:

#include <stdio.h>
#include <math.h>
int main(void){
int a,b,c;
printf("Choose the values of a, b and c for the equation ax^2 + bx + c");
scanf("%d%d%d
",a,b,c);

[code].....

View 6 Replies View Related

C++ :: Program Is Not Reading In Values From DAT File Correctly

May 20, 2013

We are supposed to split this lab into 3 files a .h and 2 .cpp's. The code I'll be talking about is going to be directed at the main.cpp file. Basically we are supposed to be able to enter as many classes into the program and when you are done the program is supposed to save the contents into a .dat file. This lab is working off of an older lab so I already have a .dat file I am trying to test with this program by reading it into my program when I first run it I prompt if the user wants to load previously entered courses and if they reply with a 'Y' the program will load the contents of the .dat file. Problem is right now when I load from the .dat file only the first class is correct. Every other class after that is just giberish. I've tried everything but can't get the restore part working. I also cannot get the save to .dat portion of this lab working either.Here is my code:

#include "Course.h"
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
using std::ios;

[code]....

View 1 Replies View Related

C++ :: Insert One Key With Three Values In Map With Client Server Program

Dec 4, 2013

I completed the program but how insert three values without using struct???

Server Program

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <iostream>
#include <netdb.h>
#include <errno.h>
#include<map>

[Code] .....

View 8 Replies View Related

C/C++ :: Program That Outputs Numbers Divisible By Two Values

May 2, 2012

A program that outputs all numbers divisible by both 5 and 6.This is what i have written :

#include<stdio.h>
int  main () { 
int i=200;
int b=10;
while(i<1000)
i b/6%==0
}

where could i have gone wrong.

View 1 Replies View Related

C++ :: Program - Unique Values To Use As Template Parameter

Oct 14, 2014

I'm looking for a way to generate a program-wide unique value to use as a template parameter. Generating a unique value within a translation unit is pretty easy with __LINE__, but that doesn't ensure uniqueness across translation units. I thought maybe I could use __FILE__, but that can't be used as a template parameter.

I stumbled across this page: [uRL] ....

which is exactly what I want, except that the anonymous namespace trick doesn't work on all the compilers I've tried it on. (This may be due to C++11 changing anonymous namespaces to internal linkage rather than external as they did before....that page is five years old.)

View 8 Replies View Related

C++ :: Switch Structures - Program To Arrange Values

Mar 5, 2012

Write a program that accepts three values (int) from the keyboard into three variables a, b and c. After loading the variables, your program will arrange the values into a, b, and c, so that a contains the larger, be the next and c the smallest.

You can use any other variables in addition to a, b c, as you see fit.

You will have to use some variation(s) of the if construct.

There are many ways to program this, but your challenge will be to achieve this without doing all possible comparisons. In fact, three comparisons woudl be enough, if you , for example, determine the largest number first, and keep track of its position in some way , so you can compare the other two.

I think I might use a code similar to the one below.

switch (expression) {
case constant1:
group of statements 1;
break;
case constant2:

[Code] ....

View 14 Replies View Related

C++ :: How To Program A Hash Map System Where Each Key Have Multiple Values Under Indexes

Nov 13, 2013

How difficult would it be to program a hash-map system where each "key" can have multiple values under indexes?

For example: "Word" -> 45(index 0) , 67(index 1) , 12(index 2). What could I start with to program this or where could I find a pre-made system that does this?

View 14 Replies View Related

C++ :: Loop Program To Go Back Without Losing Values Of Variables?

Mar 30, 2014

I know that returning to main() is not a good idea but how will I loop the program to go back to the position selection when the voter is done voting for the last position.

when I run the program it seems fine. getting the votes from President to PRO Position is fine. The problem is how will the next voter vote without losing the vote (tally) of the previous voter?

FLOW:
SELECT POSITION (a-e) ---> SELECT A CANDIDATE (a-c) ---> (this goes on until the position of PRO) ---> ( then go back to the POSITION SELECTION)

After every vote there is a case statement for which I can choose to vote for the next position, quit, or show results (and after showing the results it will go to the next position to vote)....

#include<iostream>
#include<string>
#include <conio.h>
using namespace std;
int pca=0,pcb=0,pcc=0,ptv=0;

[Code] .....

View 1 Replies View Related

C/C++ :: Program To Find Min / Max Values Of Two Ints / Doubles And Chars

Jan 31, 2015

I'm supposed to create a program that will find the min/max values of two ints, doubles, and chars, It's not completely done but here's what I have so far.

It's giving me an Error 1 error LNK2019: unresolved external symbol "public: __thiscall MinMax<int>::MinMax<int>(int,int)" (??0?$MinMax@H@@QAE@HH@Z) referenced in function _mainC:UsersDerickDesktopCiss243Week3 Assignment2Week3 Assignment2Main.objWeek3 Assignment2

Header file
#ifndef MINMAX_H
#define MINMAX_H
#include <iostream>
using namespace std;
template <class T>
class MinMax

[Code] ....

I don't know why the site is adding in extra bits of code like /> in certain areas, it's not there when I paste it in and it's not in my code ....

View 5 Replies View Related

Visual C++ :: Program Must Accept 7 Values Or Stop It When Type S

Oct 27, 2014

I want to fix this code. The program must accept 7 values or stop it when you type s. The code not only couts the element, but also some other random numbers.

Code:
#include<iostream>
using namespace std;
int main() {
int numb[7];
int i;
char s;
for (i=0;i<=6;i++)

[Code] .....

View 2 Replies View Related

C :: Simple Program To Bubble Sort Values Of A Linked List

Nov 30, 2013

HelI have been tasked with creating a program which (1) takes in integer values from a user (until the user enters -1) and inputs these values into a linked list. This (2)original list is then to be printed out. The program then uses the algorithm "bubble sort" to (3)order the list in descending order before finally printing it out again.

I have managed to do this but I kind of cheated since I do not quite understand how to manipulate a linked list. What did was I took the values in the linked list and transferred them into an array and then did bubble sort on that array.how to do bubble sort on a linked list as well as how to print a linked list.

Code:

#include<stdio.h>#include<stdlib.h>
typedef struct node
{
int info;
struct node *link;

}Node, *NodePointer;
void printList (NodePointer head)
}

[code]...

View 4 Replies View Related

C :: Program To Get Series Of Integers From A User And Storing Those Values Into Array

Feb 10, 2013

The problem deals with writing a program to geta series of integers from a user and storing those values into an array. Then use a function called selection_sort, when given an array with n elements, the function must sort the array from smallest to largest values.

I have code, and im trying to get it to compile but im getting these implicit declaration errors and conflicting types. Here is my code and the compiler errors.

Code:
Compilation started at Sun Feb 10 20:14:48

gcc -Wall -o ex9-1 ex9-1.c
ex9-1.c: In function 'main':
ex9-1.c:16:5: warning: implicit declaration of function 'selection_sort' [-Wimplicit-function-declaration]
ex9-1.c:20:2: warning: implicit declaration of function 'prinf' [-Wimplicit-function-declaration]
ex9-1.c: At top level:

[Code] ...

Compilation exited abnormally with code 1 at Sun Feb 10 20:14:49

Code:
#include <stdio.h>
int main(void) {
int a[100], i, j, N;
printf("How many numbers will you be entering: ");
scanf("%d", &N);

[Code] .....

View 4 Replies View Related

Visual C++ :: Program Doesn't Accept Input Values True?

Nov 1, 2014

I am making a program which is going to print out a head image according to the input values entered by the user. Here is the code:

Code:
#include <iostream>
#include <string>
using namespace std;
void Sides()
// draws the sides to take proportion

[Code] .....

At first i tried to work program like:

Code:
cout << "plase enter which way you want to print out the head, with parted hair or bald." << endl;
cin >> headstyle;
if (headstyle != "bald" || headstyle != "parted hair" )

But it also had given the same mistake. The program compiles BUT; even if I put in the values bald or parted hair the program prints out "wrong input" then exits.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved