This is for a class project. I am having trouble "pulling out" the last element in my array, shifting all the elements back then inserting that last value in the front. Then also displaying the array after the shift. here's my code.
#include "stdafx.h" #include<iostream> using namespace std;
here is what it does;it reads from a text file and converts the characters to ascii numbers and stores them in 1D array.what I am trying to is storing these ascii codes in 2D array.
Read *.bmp image and displaying bitmap image with scrollbar in a MFC dialog application.
I was done using this
I was read the *.bmp image as a pixel data and stored by 2D Array,
Now i want to Display this 2D array as bitmap image with scrollbar separately in the same dialog. How can i display bitmap with scrollbar using 2D array?
I'm trying to display the contents of this map. I'm having some trouble where the program ceasing to display after "Index Contents."(lines 33 -40) If I move the display for loop right where I'm inserting the values (line 52) into the map I get output. I'm not sure where bug is.
I am trying to write a c program to convert centimeters to inches and then to feet. I have most of the code written but not sure how to debug it. I keep getting "0" as all of my output.
#include <stdio.h> // Main Function int main(void)
I have turbo c++ on windows xp SP2.....whenever i compile my code in turbo c++ i am getting output outside the screen.....but when i used code::block....i get the correct output...fits to screen ...
I'm currently working on a temperature conversion program using arrays / pointers as practice.
I will post the code below, its quite a bit lengthy and its also incomplete. Everything was going smoothly and I continually test my code as I write to completion, then I ran into a small road block.
My problem here is regarding the output from the first if statement in main. When I enter a value to convert from F to C. It successfully converts the first value I enter, but any other value after the first one during the loop in the first if statement, just shows long numbers of all sorts.
The output looks like this:
I kept checking the logic behind what I did, and for me it seems to be correct. Here is the code:
The void function must pass as a parameter a pointer to the first element of the Orders_Placed array. I have attempted to write this. But I do not think I am even close. I need to have 7 double variables that hold the totals for each day of the week. Those are the MonTotals , TueTotals , etc....
How do I get these totals for each day?
How do I fix this void function so that is displays the most profitable day. Also, would the function call be Biggest_Profit(Orders_Placed)??
The GetPrice function provides the price given a menu item.
I've finally been able to get my coding corrected after doing this for 5 hours and watching numerous tutorials on it... But I now need to create a table. how to create a table with dashed lines like -----------------, both vertical and horizontal.
Another issue I have is that I'm having trouble trying to get a prompt to ask the user how many programs, tests, and quizzes he/she completed with their total points. I got the basic programming done, but need a prompt asking "How many (quizzes, tests, or programs) have you completed?"
Finally, the do-while loop is driving me insane, where I have to set certain values. If it is greater than 2, then I insert formula 1, but if it is less than 2, then I insert formula 2. Whichever way it goes, the total points earned minus the two lowest scores are then calculated into an average.
Code:
#include <iostream> #include <iomanip> #include <string> using namespace std; int main()
[code]....
The whole basis of the program is to calculate the averages of programs, tests, and quizzes done during a semester at a school. The user is asked how many of each category he/she has completed (total points earned and total points possible). All of this is then calculated into a cumulative class average in a table along with points earned and points possible for each category (along with tests and quizzes combined into one average along with individual averages).
I have started working with structures so here's a side project from my text book. It's purpose is fairly simple; it asks for the sales of each quarter of the year from 4 different divisions and then calculates the average quarterly sales and total annual sales and finally displays all the data. My problem is that in the function "displayCompanyInfo" the statement
std::cout << "Division " << R.division_name << std::endl; does not display the name of the division. With that in mind here is the code: #include <iostream> #include <string> struct CompanyInfo {
[Code]....
As you can see the last part of the output has statements that say "Division" however they do not say the name of the division afterwards. I don't understand why that is?
I used getline to import EMPLOYEE's First and Last Name from a txt file. After calculating the weights ans stuff. Now when i try to write to output txt file am having the below issue in which its not putting it in one line.
***CODE*** fout << "Note: This report for " << employee << " was prepared according to the fair practice of the University." << endl ;
***THIS IS WHAT ITS PRINTING*** Note: This report for FIRSTNAME LASTNAME was prepared according to the fair practice of the University.
I also tried like this;
***CODE*** fout << "Note: This report for " << getline(fin, employee) <<" was prepared according to the fair practice of the University." << endl ;
***THIS IS WHAT ITS PRINTING*** Note: This report for 0 was prepared according to the fair practice of the University.
this second code puts everything in one line but its showing 0 (zero) instead of the employee's first and last name.
When this programs runs it displays odd symbols for the address of the character. This is only part of the program, I took out the parts that already work.
#include <iostream> using namespace std; char again;
I am trying to display a messagebox, but instead of just displaying the message box, there is also a console the pops up. How do I prevent the console from popping up? I'm using Visual Studio 2012. I'm creating an empty project, but I still get the console.
#include <iostream> #include <iomanip> using namespace std; //function prototypes int getFahrenheit(); double calcCelsius(int tempF)
[Code] ....
for some reason it keeps giving me a Error C2144: syntax error: 'int' should be preceded by ';' on line 16 column 1 Error C2143: syntax error: missing ';' before 'return' on line 34 column 1 IntelliSence: expected a ';' on Line 34 Column 2
I have tried to fix both of these problems and no matter what I do I either get more errors or they wont go away...
I want to input a string, say: abcdaa so, the program should output:
a b c d
In other words, the program will display each character for only ONCE!!!! And display their frequency. Here is my idea: user will input a string and such string will be copied into another string variable called "checker".There will be a loop and each character will be printed, BUT, first, the program will check if the character to be printed is not equals to all elements of the checker string.
I already have the function to count the frequency of each character
GOAL: to make a program that will accept a string and use the HUFFMAN CODING to compress it.