C :: Create A Basic Soccer Points Projection Program
Nov 12, 2014
I'm basically trying to create a program that will project a soccer teams points for the whole season. Here are the basics:
Total games: 38
Win: 3 pts
Draw: 1 pt
Loss: 0 pts
My program compiles fine, but inevitably crashes right before the if statement..
Code:
#include<stdio.h>
int main(void)
{
float ppg, games_played, games_left, points_earned, pts_proj;
char team_one;
}
[code]....
View 4 Replies
ADVERTISEMENT
Oct 29, 2014
Write a program that will search soccer players data to check whether a name supplied by the user is on that list. For doing the search, the user may provide either the player’s full last name or one or more starting letters of the last name. If a matching last name is found, the program will display the player’s full name and date of birth. Otherwise, it will display “Not found”.
Requirements specification:At the start, the program will ask the user to enter information about 10 soccer players constituting soccer player data. Each soccer player data will consist of the following fields:
Last name
First name
Birth month
Birth day
Birth year
The user will be asked to enter each soccer player data on a separate line with the field values separated by a space.
Once the data is entered, the program will display a menu of choices as below:
Chose an option:
(1 – input data, 2 – display original data, 3 – sort data , 4 – display sorted data 5 – search by last name 6 – exit the program )
If the user chooses option 1, the program will ask the user for a data and populate the array of structures that will hold the data for each of the soccer players.
If the user chooses option 2, the program will display data in the order provided by the user (original data).
If use chooses option 3, the program will sort data by last name.
If user chooses number 4 the program will display the data sorted by last name.
If the user chooses option 5, the program will ask the user to enter one or more starting letters of the soccer player’s last name. It will then search the soccer player data for the matching last name. If a match is found, it will display the first player found with the matching pattern. If a match is not found, the program will display “Not found”. If the user enters two forward slashes (//) for the last name, it will no longer search for the name. Instead it will display the main option menu.
If the user chooses option 6, the program will display “Thank you for using this program” and will end.
Why my program isint executing correctly. Here is what i've so far . . . .
#include <iostream>
#include <string>
using namespace std;
struct data {
string lname;
string fname;
int birthmonth;
int birthday;
int birthyear;
[Code]...
View 3 Replies
View Related
Dec 29, 2012
I want to create a basic window using visual c++ 2010 express.
View 1 Replies
View Related
Sep 29, 2013
I am having trouble with an assignment. The assignment consists of a basic encryption and decryption program already written for me, I just have to write the encryption function. What we have to get the program to do is enter an integer and a text, and get the program to increment each letter in the text by the integer given. I did this by using a for loop and incrementing each value in the string by the integer.
However, I still can't get it to decrypt and I need the program to work with only a-z letters (if I increment each letter by 3 and I have the letter Z, it should go to Z+3 = C).
I attached the description of the attachment and below are the codes: The first file does not need to be edited.
Code:
/*******************Programming Assignment 1***************/
/****************Caesar's substitution cipher**************/
/*****************YOU MUST NOT EDIT THIS FILE**************/
/****Substitute alphabets in a string using rotation key***/
/****Leave all other characters unchanged******************/
/****Confirm correct encryption by decrypting**************/
[Code] ......
View 1 Replies
View Related
Feb 4, 2014
Code:
#include <stdio.h>
void Swap(int *x, int *y);
int *Largest(int *array, int size);
int main()
{
int a, b, i;
int c[10];
int maxaddress;
}
[code]...
My swap function works fine, but I am trying to find the ADDRESS of the largest element in my array and I am getting an error using gcc on my "return &largest;" and my printf line in my main function.How can I fix this and return the address of the largest?
View 8 Replies
View Related
Feb 22, 2012
I have created a simple basic program that uses sockets but it can only handle one connection, how do I make it so it handles multiple connections?
Server code:
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;
}
[code]...
View 5 Replies
View Related
May 18, 2014
This is my program
#include<iostream.h>
#include<conio.h>
#include<string.h>
#include<stdio.h>
#include<math.h>
struct date
{int dd,mm,yy;}
[Code] ....
Error in Line 11:Too many types in declaration
View 2 Replies
View Related
Feb 29, 2012
im trying to write a program that prompts the user to enter three numbers and then prints them vertically (each on one line), first forward and then reversed. this is how the design should look:
enter three numbers: 1 43 54
your numbers fowards:
1
43
54
your numbers backwards:
54
43
1
this is what i have thus far when it comes to code....
#include <stdio>
int main (void) {
// local declarations
int a;
int b;
int c
[code].....
View 1 Replies
View Related
Aug 6, 2014
I am trying to send yahoo mail using socket program.
Using the commands like ehlo, starttls, auth login, data,.,quit.
but starttls is error. yahoo close itself. one more thing i use this same method for gmail is working.
The problem is we must enable the ssl authentication. Like System.net mail in .net package smtp.enablessl=true. how i enable ssl authentication in starttls in c++ program
View 1 Replies
View Related
May 16, 2014
I tried to build a basic username-password verification program; I already have 2 text documents, usr.txt and pass.txt in which username and password are stored. Then have written this program to check the username and password, but every time it says Access Denied.
Here's what I have written:
#include<stdio.h>
#include<conio.h>
void main()
[Code].....
View 6 Replies
View Related
Oct 19, 2014
I am making a very basic parent/child class based program that shows polymorphism. It does not compile due to a few syntax errors reading "function call missing argument list. Lines 76 and 77, 81 and 82, and 86 and 87.
#include<iostream>
using namespace std;
class people {
public:
virtual void height(double h) = 0;
virtual void weight(double w) = 0;
[Code] ....
View 4 Replies
View Related
Nov 3, 2014
Example: In a 2-D space, point A=(a1,a2) is bigger than point B=(b1,b2), if a1>b1 and a2>b2.
How do I write a presudo code to find all the maximal points among the given n points?
View 14 Replies
View Related
Jul 3, 2013
Currently I am working on a program that will find the actual distance between two points on a grid. It also determines the angle of the line segment in degrees. Now, i need it to be able to find any other points on or near the line. It will be running in a loop to find each additional point sequentially until all the points have been plotted. Unfortunately, I am not entirely sure how this is done. So far, I think that I could develop an algorithm that converts the angle into a ratio of vertical movements to horizontal ones.
View 7 Replies
View Related
Jan 26, 2015
I want to create a program that would take an AVI file, alter each frame (ex: change contrast, invert colors, etc.) and dump a new AVI. I've wrote a simple program for this experiment that loads up the header information from the video and dumps it. It also dumps a list of the frame data chunks within the 'movi' chunk.
The info I've gathered from coding this:
1. The recommended buffer size for each type of stream (vids, auds, etc.) is the size of the largest frame of corresponding type, plus 1 or two extra bytes.
2. numFrames in main header is the total number of frames for all types of data (video,audio,etc.) The 'length' value within stream header of type 'vids' is the number of video frames. The sizeImage value within BITMAPINFOHEADER is 921600 (==640*480*3) and the specification states that, quoth, "This can be set to 0 for uncompressed RGB bitmaps."
3. This video uses DIVX encoding.
Now my problem is this: How do I get the data within each video frame in a simple BMP like format? Even the uncompressed frames (with chunk id 'nndb') have variable sizes...let alone the compressed ones.
Information about a software that converts AVIs to a format with fixed sized uncompressed frames. Or at least some information about the frame decompression techniques.
Here's a dump made by the program for a 9 sec, 640x480 video I recorded from Pokemon. (Without the frame dump that is, it'd have made the post too long.)
Code:
AviMainHeader
-------------
size = 56
usecPerFrame = 66666
maxBytesPerSec = 7680000
padSize = 0
flags = 0x00000810
numFrames = 162
initialFrames = 0
numStreams = 2
[Code]...
View 4 Replies
View Related
Oct 29, 2014
So, I was trying to code a menu for a personal movie database. But I'm having some problems.So, this is what I did,
Code:
#include<stdio.h>
int main();
{
do
{printf("Menu
[Code]...
But this is not working.Furthermore I would also like add a sub menu.
View 7 Replies
View Related
Feb 14, 2013
What I am trying to do is to have the program create 2D array that for each row, no two numbers are the same and only consists numbers between 1-9. The array lists out every possible combinations. Supposely I do not know the number of possible combinations, I had it keep adding new rows until there are no more possiblities left.
The problem with my code is when I print out the completed array, it gives out really, really large numbers. But when I print the array from inside the first loop, it gives correct values. I do not know exactly what happened.
Code:
#include <stdio.h>
int main(void) {
int double_digit[1][2];
int a = 1;
int b = 1;
[Code] ....
View 5 Replies
View Related
Sep 2, 2013
I have a homework assignment due that told me for the "input specification" that "n" is an integer greater then 0. How would I put this in and where?
View 1 Replies
View Related
Apr 10, 2014
i want to create a program which consist of 2 function. one function should find the greatest number and the other one should calculate the average but when i run this program i get segmentation fault
Code:
#include<stdio.h>
int main() {
int k,i,A[k];
[Code]....
View 8 Replies
View Related
Nov 16, 2013
I would like to create a C program which requires the input in this form: number1 operator number2, where number1 and number2 are numbers of type double and operator is one of the characters +,-,*,/.
There is my attempt to write this code:
Code:
#include <stdio.h>
double main() {
char operator;
[Code]....
Now I have to solve these problems: This code above doesn't work and I don't know why.I don't know how to fix the case when some user enters the input in this form:
Code: 1.5896 *5 or
Code: 7 / 5
I mean how the program knows that
Code: 1.5896 *5 is the same as
Code: 1.5896*5
I don't know how to fix the case when the user enters the input in the incorrect form for example
Code: 3
View 4 Replies
View Related
Mar 30, 2014
create a program that trigonometric series ∑(k-3)sin(π/k-3) with k = 4 until 13..
View 1 Replies
View Related
Nov 5, 2013
You are to create a program using nested looping. Your program is to have a menu asking the user to select which pattern to create and how many rows to use (it should accept 1 to 10 rows and keep the aspect ratio of the pattern). The patterns are 1 - Box, 2 - V, 3 - Inverted V. Note, if I select pattern 1 with 10 rows, the box will have 10 asterisks in the first row.
Okay so i came up with the box but i have been getting stuck at getting the V or inverted V.
View 1 Replies
View Related
Apr 6, 2014
Im trying to create two box in this program using the default constructor. When i call to try and display the info, it says that x, y, and z are not declared in this scope. i wanted to have the user cin the length, height, and width using the void setBox function.
#include<iostream>
#include<string>
#include<cstdlib>
using namespace std;
class Box{
public:
[code]....
View 2 Replies
View Related
Sep 4, 2013
how can I create a program that will accept 2 two integers. the user will also choose among the different operations:
1 for addition
2 for subtraction
3 for multiplication
4 for division
View 4 Replies
View Related
Aug 18, 2013
i am trying to create a program for multiple windows. Here is my code
#include<Windows.h>
// Store handles to the main window and application instance globally.
HWND ghFirstWnd =0;
HWND ghSecondWnd=0;
HWND ghThirdWnd=0;
HINSTANCE ghAppInst=0;
[Code]...
problem is when i try to execute the code it just say create window1- failed!!
View 1 Replies
View Related
Feb 10, 2015
1. Write a c++ program to create a vector of integers. copy the vector contents into list, sort the contents, then copy selected items into another vector(like elements less than 10 etc)
View 1 Replies
View Related
Apr 2, 2013
I am trying to write a program that creates a hybrid image I've hit a roadblock early on my code throws up an unhandled exception I cant find where it goes wrong I need a fresh perspective on this. Here is my code so far
#include <iostream>
#include <cv.h>
#include <highgui.h>
#include <stdio.h>
using namespace cv;
Point P11, P12;
Point P21, P22;
[Code] .....
View 5 Replies
View Related