I need coding this project using while loops and cout/cin.. It is suppose to be one while loop for the whole thing and inside of the first while loop is the second while loop for each sale separately.
You have been asked to write a program to calculate sales totals for a general store. Your program will not know how many products each customer will buy, so your program will have to repeat the process until the last product has been entered (use -1 for Product ID to end each sale). After each sale your program must ask if you want to do another sale (Y - continue, N - end program).
At the beginning of the day, the cash drawer has $500 in it. At the end of the program you must display how much money is in the drawer after handling all your sales transactions.
Input Your program must take the following input: - Product ID Number (int) - Quantity for each item purchased (int) - Cash Received at the end of the sale
Use the following dataset to determine the price and taxability for each item.
First Sale: Product ID Price Quantity Taxable 101 $65.00 2 Yes 102 $12.50 1 No 103 $24.50 5 No 104 $38.75 4 Yes 105 $17.80 6 Yes 106 $16.50 2 No 107 $42.85 8 Yes 108 $32.99 2 Yes 109 $28.75 1 Yes 110 $51.55 1 No
Second Sale: Product ID Price Quantity Taxable 102 $12.50 1 No 103 $24.50 1 No 106 $16.50 1 No 107 $42.85 1 Yes 108 $32.99 1 Yes 109 $28.75 1 Yes
Third Sale: Product ID Price Quantity Taxable 106 $16.50 4 No 107 $42.85 3 Yes 108 $32.99 1 Yes 109 $28.75 5 Yes 110 $51.55 2 No
Calculating Tax For those items that are taxable, assume a 7.5% sales tax. Be sure to keep a running total of tax for the each sale.
Getting Started You must use the starter file provided with this assignment. What to turn in: - A copy of your source code - A printout of your program's output
Trying to show the Row totals and the Column totals.
#include <stdio.h> int main() { /* start of main */ #define NUMROWS 5 /* establishes NUMROWS as 5 */ #define NUMCOLS 5 /* establishes NUMCOLS as 5 */ int val[NUMROWS][NUMCOLS] = { {23,06,85,22,01}, /* declares array val to have 5 rows and 5 columns */ {07,33,62,17,04},
[Code] ....
I receive this message after building:
1>------ Build started: Project: WA 4 A 1 Christopher Caron, Configuration: Debug Win32 ------ 1> WA 4 A 1 Christopher Caron.cpp 1>c:userschrisdocumentsvisual studio 2010projectswa 4 christopher caronwa 4 christopher caronwa 4 a 1 christopher caron.cpp(21): error C2106: '=' : left operand must be l-value
I am writing a program where f is the frequency and the x has the values as well. Now I am calculating the mean which is summation fx divided by summation f. I have the two functions working correctly but the getmean function is not working. It suppose to divide fx/f . check the code below
#include <iostream> using namespace std; const int SIZE=5; class statisticalOperator{
'm new to programing and I'm trying to get this program to add up a price of coffee to the add on extras such as cinnamon, etc. But once the program runs it doesn't add up the coffee price with the extras and I've been at it for hours...
Code:
#include <iostream> #include <cstdlib> using namespace std; int main()
I'm currently trying to work with more than one form, but I didn't succeed yet. What I need is quite simple: Once the program runs, a small form appears first asking "what would you like to do" with corresponding buttons for each option. Each button loads a new different form for a different task. So basically I need to open and close forms, also having two forms loaded at the same time (pop-up style) would be great for certain purposes.
I still haven't figured how to do it properly. I'm currently using VC++ 2008 and my project is a Windows Forms Application.
The code is supposed to display the total and averages of the data as well, but cuts off due to an error in the code. The code should also:
1)Print checks for all employees, one per page, sorted by lastname. The first check number, 100, is to be read from a company data file (see requirement 4). The border of each check is important and should not be omitted.
2)Convert the net pay to a text string for each check printed.
3)Print a reference code on each check. The reference code is obtained by combining the first letter of the lastname with all the consonants remaining after removing all vowels (a,e,i,o,u).
4)Use the same employee data found in assignment 2. Use the following company data, obtained from a text file,
Output I'm expecting: Program to display totals and averages (worked before I turned everything into an array), now exits with error before totals/averages are displayed. Program also writes up a report.txt file that also writes this information into it, as well as using a quicksort to organize the names alphabetically, and print paychecks (all of the #BORDER, #HEADER1-8, #STUB, etc). In that check a reference code is also generated (teacher gave us code, we just had to modify for our final program as seen here)
Flow of the program: Print headings to label all of the input data we will enter soon under the categories as listed in the heading. Initialize all of our totals (in our array) to value of 0. These will be added in a loop "AddAccumulators" which takes our value for the hours, payrate, and taxes from each employee array structure and adds it to the total array. Program will write this information into the report.txt file with the HEADER line for totals, and should be displaying it in that picture. (Same for averages). After all of the data is calculated, the Reference code, Totals, Averages, and individual employee data is taken and put into printing out a Check Header and Stub.
I am doing a modification to a school project call rainfall statistics. I have that written, but need to sort the array and list rainfall totals from highest to lowest. I thought I knew what I was doing but I am having some difficulty locating all my errors, the error I keep getting now is:
1>------ Build started: Project: Rainfall Statistics Program, Configuration: Debug Win32 ------ 1> Rainfall-main.cpp 1>Rainfall-main.cpp(88): error C2601: 'sortHighest2Lowest' : local function definitions are illegal 1> Rainfall-main.cpp(25): this line contains a '{' which has not yet been matched 1>Rainfall-main.cpp(96): error C2065: 'TOTAL_NUM_OF_MONTHS' : undeclared identifier ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Below is my code, I know i'm missing something, just can't see it.
#include <iostream> #include <iomanip> #include <string> using namespace std;
//Here are the function prototypes double getTotalRainfall(double[], int); double getAverageRainfall(double[], int);
I have a slider control on a dialog box. I am playing a video file and slider moves according to the video elapsed. Suppose I have set the slider range to 100. Now till some point say 90, the slider moves to the point wherever I click the mouse. but at the last point in between some range say 90 - 100 (to the end of the slider), if I click the mouse button anywhere, slider jumps to the end.
I am using a TimeLine control where user can add more than 1 video (1, 2, 4, 8, 10 , 50 etc......), If I use only one video, slider moves as per the video progression.....Issue arises when I add more than 1 video and click on the start button, slider starts moving....Now when I drag the slider to any position or I click the mouse button anywhere on the slider control, slider thumb moves to that position and immediately jumps back to some other position. This is the Issue, I am facing.
share some sample code where slider is moving with the video showing the progress of the video.
I want to implement a functionality similar to VLC player. Wherever user clicks the mouse, slider moves to that point.
I keep having problems with CMFCPropertySheets. I now have it embedded in a resizable dialog and the property sheet and page gets resized when dialog is resized all that is working fine.
Problem is OnSize is being called when the dialog is being resized NOT when it has finished resizing so the values reported in cx and cy is the old size not the size AFTER resizing. What could be causing this? Isn't OnSize call AFTER the size has been changed and OnSizing called WHILE the size is being changed?
I have a list control that needs to take up full rect in each page and when the dialog is maximized it stays at previous size even though the sheet and page have both maximized as they should.
I ran a trace on the OnSize even for both the sheet and page and OnSize is being called during the sizing and not after it has already been sized like it is supposed to.
Just using Find in my source code to look for variables or whatever, works once or twice then just stops - Doesn't find anything even if it's there. If I restart VS it works again, but not for long.
I downloaded Visual Studio 2013 on a new laptop. On my old one I could press things like ctrl + F7 to compile and ctrl + F5 to start without debugging however now it isn't responding when I type those commands. Nothing happens at all. How to change this? I googled "keyboard shortcuts not working in Visual Studio 2013" but per the usual Google comes up with garbage search results that do not pertain at all.
I can't get tooltips to show up for the windows I want in my CFormView derived class. I have copied the code from the MSDN entry on EnableToolTips(). But only two windows respond with a tooltip:
CONTROL "Tree1",IDC_TESTPLANS,"SysTreeView32",TVS_HASBUTTONS | TVS_HASLINES | TVS_EDITLABELS | TVS_SHOWSELALWAYS | WS_BORDER | WS_HSCROLL | WS_TABSTOP,1,36,85,91 CONTROL "Tab1",IDC_TABCMD,"SysTabControl32",0x0,101,0,239,181
Other windows do not respond. For these windows my function designed to catch the TTN_NEEDTEXTW and TTN_NEEDTEXTA messages is not called. Windows such as
(CCntrlView is the name of my class derived from CFormView.) And as I pointed out, I'm using the code straight from the example given in MSDN for CWnd::EnableToolTips(), with the only difference being that all my controls are created in the rc file as shown above.
I'm having problem using the click event in a web browser control. I have a control called CIEBrowser that implements a Web control. Here a message_map:
I have a dialog with a control using this CFulltextCtrl. I can create and show the html perfectly inside the form. But all links inside this control don't work (scenario 1). If I create a form who have a control of the type CIEBrowser, the EXACTLY same html code works perfectly (scenario 2).
In particular, I need that when I click in one link, execute a method called OnClick, who performs all that I need, just like in scenario 2.
This is my DISPATCH_MAP in the derived class (CFulltextCtrl):
Equation for compound interest. The interest is supposed to be $43.34 according to the book, I am ending up with around $35. The actual equation is amount = principal * (1 + rate/t)^t where t = number of times compounded per year. I still have to go through and clean up all the code I just want the formula working first.
#include <iostream> #include <iomanip> #include <cmath> using namespace std; int main () { float princ, rate, comp, savings, interest, rates, year;
We are suppose to build a program to do the quadratic formula, which isnt really a issue. my issue is i have a if else loop and my if is being ignored.
note: i know that i can use the i number system but we have been asked to not too and to do this instead.
here is my code
#include <stdio.h> #include <math.h> int main() { float a, b, c, d, e, f, g, h, i; /* i would love to figure out a way to do this without so many variables*/
I'm programming with VS2010, for windows 7. The user likes to use the windows classic theme, and I discovered that BS_MULTILINE style isn't working as I expect. When a button is pressed in the classic theme, it looks like there is a temporary margin added that causes the text to wrap only when the button is pushed. It works fine with any other theme.