C/C++ :: Program To Display Two Statistic Sheets For Airplane Races?
Mar 17, 2014
I am writing a program to display two statistic sheets for airplane races. with Acceleration being a random number 5-25. for every second it should display a stat for speed, and distance(Both planes)I am at a loss for how to call the functions separate and side by side respectively.
I am supposed to create a program that assigns passenger seats in an airplane. First I am suppose to generate an array with random X's. Then I am supposed to ask the user to pick a seat. From there I am supposed to check if the seat is already taken. My problem is when I ask them to pick a seat it generates an array of nothing but X's. Also how would I allow the program to accept the seat numbers as either uppercase or lowercase letters. for example if they want seat '3C' how would I allow them to enter the C as either a lower case or upper case.
I have written a CFD program that final results store at several 2D arrays. For instance, temperature of a square plate. For every point of plate i and j (i,j), I have a temperature amount. On the other hand, these temperatures change by time.
theSpace.TheCells[i, j,0].Temperature
I would like to save these data into an excel file and each sheet contains data for specific time (for example, an excel file with 50 sheets that cell number shows the coordinate of a point and the value in it is the temperature and next time step data's will be in the next sheet of current workbook )
I was thinking my code should be something like the following note, but it doesn't work:
// Implement time loop int counter = 0; for (int step= 1; step<= MaxSteps; step++) { // call Excel output method ExportData(ResultsArray,step,nx,ny);
I'm trying to create a program to calculate the flight time and fuel burn of an airplane. However when I repeated the whole calculation, it did not show any data or result like the previous calculation. In addition, the "If" statement that I used to test the "fuelRemain" doesn't work properly. I can't figure out why.
I have been playing around with property sheets/property pages and have been successful in getting them to work in a secondary dialog by calling the property sheet using DoModal().
How to get the property sheet to display on the main dialog of a dialog application.
I am using VS2008 and CMFCPropertySheet and CMFCPropertyPage.
The assignment is to read in a text file of passenger names (first and last initial), seats (A1, B1, C1, D1, A2, etc.), and ticket prices. The output is specified to be a table of passengers and their seats sorted by seat order, and I also have to print the minimum and maximum ticket prices along with the owner of each ticket, along with the average of all ticket prices. My arrays are all reading in correctly, and the minimum, maximum, and average ticket prices were all easy to find. My problem is the sorting.
We were introduced to arrays a couple weeks ago and this is our first time doing any sorting. We are supposed to use a bubble sort, and while I think I gather how to use a bubble sort, it's not working in my program (so obviously I don't really know how to use it). I have tried several different things, and sometimes a few seats/names will switch around (never the way I want them to) and sometimes nothing will happen at all.
New to programming, not trying to get homework done for me, need to bubble sort airplane passengers and seats by seat order (A1, B1, C1, D1, A2, etc).
My input looks like this:
A Z A1 555.55
repeat with different initials, seats, and prices however many times the user sees fit.
I have a 1D character array for the columns(A - D), a 1D integer array for rows (1 to maximum integer), 1D float array for prices, and 2D array for name initals.
Now I can fatch all the excel sheet belongs to the Excel File.But How can I check "If and Only If the sheets are havin Underscore in their name(eg. student_data,teachers_data) then only the data of the sheets will populate in tha data base"
i wrote this program to display even number from 100-200. But visual c gives me this error with undeling the "a" in if statement. Error1error C2106: '=' : left operand must be l-value
Write a program that displays the first 40 Fibonacci numbers. A Fibonacci number is created by add the previous two, with the first two always being 0 and 1. A partial sequence is as follows:
0, 1, 1, 2, 3, 5, 8, 13, 21,….
Your table must display 6 numbers per row and use a spacing of 10 for each number. Don’t forget to include the header file “iomanip” at the top and use “setw()”. You will need to turn in an algorithm, source code and output.
Here is what i have but i get errors!
#include <iostream> using namespace std; { int FirstNumber = 0; int SecondNumber = 1; int NumberOfNumbers = 2; int NewNumber;
Also is there a way to display the time only instead of the date? How will i change the program to display the time in standard 12 hours, instead of 24 hours?
#include <iostream> #include <time.h> using namespace std; int main() { time_t tim; time(&tim); cout << ctime(&tim); }
Write a program that asks the user to enter the number of calories and fat grams in a food item. The program should display the percentage of the calories that come from fat. One gram of fat has 9 calories, so:
(Calories from fat) = (fat grams) * 9
The percentage of calories from fat can be calculated as:
(Calories from fat) / (total calories)
Extend as follow
1. The user first enters from a menu whether it is breakfast (B or b), lunch (L or l) or dinner (D or d). Use character and process by a switch. 2. The threshold for low calorie is different, for breakfast 10%, lunch 20%, dinner 30% (this value has to be assigned to some threshold variable in the above switch). 3. Include validation of menu choice. 4. In case any validation fails, display detailed error and exit the program by calling return 1 or return EXIT_FAILURE 5. Display the % from fat with one decimal digit.
Example 1: What you have to eat: B - breakfast L - lunch D - dinner What you have: C Error: C is not a valid menu choice
Example 2: What you have to eat: B - breakfast L - lunch D - dinner What you have: L How many calories: 600 How many grams of fat: 10 Your food has 15.0% calories from fat It is a low calories food
Process the menu in a switch, setting the threshold as either 10, 20, or 30%. The rest of the program will be the same regardless what was the menu choice.
Incremental development: first do the textbook problem without input validation, then extend with validation, then extend for the additional parts.
IM trying to make a simple program that will display morse code. Ex if you type 0 print should be (-----) and all the way up to 5. The problem is though that all printf displays all the numbers and not executing only the assigned variable.
#include<stdio.h> int main(void) { int a , b , c , d , e, f, x;
I decided to create a simple program to display a menu with options, while that is easy enough I had some difficulty when selecting an option that has options inside which also has an option again. While I had many issues in the past I'm finally finished with it and it works fine, but being new to programming and not knowing various other methods available.
Code: //:::::::::::::::::::::Simple Menu Program:::::::::::::::: //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
SO Im supposed to write a program that uses arrays to calculate the sum and display it. I keep getting the error that says the sum has to be initialized.
#include <iostream> using namespace std; //Function prototype int sumArray(int); const int NUM_ELEMENTS = 5;
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 company data, obtained from a text file, for each check printed:
i need the output to display the product of every whole number from 1-3 in a table format.
this is the code i have so far. i know some brackets are missing but i just pasted the meat of the code. when i run the program i keep getting the number 1 displayed in a straight line going on forever
Write a program that will generate, but not display, a three-digit "target" number that has three distinct digits. (Hint: use random number generator.) Then, input a maximum of ten user guesses and for each guess, output the number of hits and matches in the guess. Stop when the user guesses the number or runs out of guesses. For example, if the target is 427, the guess 207 has one hit (7) and one match (2).
I'm new to coding, and I have to write a program to display a class schedule to the user (the classes are entered into the program in strings like this:
in the format of an excel file (the user picks the classes they want to have) that then displays the course title and professor in the correct cell corresponding to the day/time the class meets. I've been googling it, and from what I've read, I think I need to use a csv file, but I don't know how to input the data into the file. I know the general format for how data is entered, but I don't know how to write it into a specific file or if I even have to (we covered txt files very briefly in my class, but never touched csv files).
I need to make a program using public and private classes. I need to make a farm of five animals using the class Animal and the class has to contain charactaristics about animals i.e. speech or number of legs. So when I run the program it should output a number set to each animal and then it would display the characteristics of the selected animal.