C/C++ :: Program That Accepts Information And Calculated CGPA
Jan 30, 2015
i want to display the grade report of two students in the table but this code will repeat the grade report of one student in the tables and what is wrong with this code below ?
#include<iostream>
#include<string>
#include<fstream>
using namespace std;
[Code]....
View 3 Replies
ADVERTISEMENT
Jan 16, 2015
#include<fstream>
#include<iostream>
#include<string>
[Code]...
View 2 Replies
View Related
Nov 18, 2014
Here's the question: Create a program that accepts an array of characters. And displays the converted array of characters into Upper case if it is given in Lowercase and vice versa. Don't use string, but char.
Example: mychar ="I am A conQUeror."
Code: //My Codes:
#include <iostream>
#include <conio.h>
using namespace std;
int main()
[Code] ....
View 5 Replies
View Related
Sep 25, 2014
I was trying to code a program that accepts your first name and then last name and then displays it through another function. I have checked that the assignments are between similar type of variables and pointers, but I don't seem to get it right.
When first input is taken and then second one, the first one's value changes to same as the second. E.G if first name is L and second name is S and after second input both variables, first and sec, become equal to S. Why?
Code:
#include <stdio.h>
#include <stdlib.h>
//FUNCTION PROTOTYPES
char *input(void);
void show(char *f,char *s);
[code]....
View 7 Replies
View Related
Dec 8, 2013
I built a program that accepts two input from the user, using a array inside a loop, it is pass to a function inside a class which will display the two number, the problem is when the user is inputting a number and it is 1 the program continuously as the user to input a number, and when 2 is entered the program ask another number and end, but for example you entered 2 and 3. . . it will then outpu 2 and 4 (so 3 + 1 ) and always the last number is plus one. here is the code.
main.cpp
#include <iostream>
#include "newclass.h"
using namespace std;
[Code].....
View 5 Replies
View Related
Feb 4, 2015
I have a N queens (actually 8 queens to be specific) program that accepts the numbers in order by row. I need to get it so it accepts the numbers in order by column. At first glance I thought it was just one space different, but it turned out not to be and how to get the one space difference in there. My current code (which I'm aware isn't doing the column accepting right) is:
Code:
#include <iostream>
using namespace std;
int main() {
int board[8];
cout << "Enter the columns containing queens, in order by column: ";
for(int i = 0; i < 8; ++i) {
cin >> board[i];
[Code]...
What the output should be:
Code:
Enter the rows containing queens, in order by column:
7
6
5
3
4
2
1
0
.......Q
......Q.
.....Q..
...Q....
....Q...
..Q.....
.Q......
Q.......
What it is:
Code:
Enter the columns containing queens, in order by column:
7
6
5
3
4
2
1
0
........Q
.......Q.
......Q..
....Q....
.....Q...
...Q.....
..Q......
.Q.......
View 5 Replies
View Related
Aug 10, 2014
You pros are once newbies like us. Hoped you might take a little time sharing your expertise. Got freaked out when our teacher gave us this activity, where she haven't taught this to us yet. So this is the activity (LOOPING) :
Write a program that accepts a positive integer. The program should be the same from the given output. Use do while to allow the user to continue or not.
OUTPUT must be:
n = 5
0
1==0
2==1==0
3==2==1==0
4==3==2==1==0
5==4==3==2==1==0
if n = 6
0
1==0
2==1==0
3==2==1==0
4==3==2==1==0
5==4==3==2==1==0
6==5==4==3==2==1==0
View 5 Replies
View Related
Aug 15, 2013
I've been tasked with righting a program that accepts three images and combines them into a panoramic view I'm having trouble getting started?
View 2 Replies
View Related
Apr 8, 2013
i am doing a sales commission program to run a counter on the commission calculated, but the answers can't show on the counter
here's what i've done so far:
#include <iostream>
#include <iomanip>
#include <cmath>
[Code].....
View 2 Replies
View Related
Jun 25, 2014
I am doing a program that saves information on the memory and then i need to put by ascending order the student number.. but i can't get it to work...i tried with strcmp but not worked...
Code:
typedef struct {
char name[100], email[100], adress[100], postal[100], number[20];
int phone
}data; t
Then i have this to input data
Code:
void add(data* contact) {
if (i<total) {
printf("
Name: ", i + 1);
fflush(stdin);
[Code] ....
View 13 Replies
View Related
May 6, 2013
my program wont output any information to the text file that I have specified it just creates it but it leaves it blank
#include <iostream>
#include<string>
#include<iomanip>
#include <fstream>
using namespace std;
class Carloan
[code]....
View 2 Replies
View Related
Jul 2, 2014
I wrote a program to grade T or F test. It is running, but not outputting the information.
Code:
#include<iostream>
#include<string>
#include<fstream>
#include<iomanip>
using namespace std;
double grading(char*answer, char* stuResponse, double graded);
[Code] ...
text doc:
TFFTFFTTTTFFTFTFTFTT
ABC5403 TFTFTFTT TFTFTFFTTFT
ABC5404 TFTFFTTFFTFFFTTTFTFT
View 5 Replies
View Related
Apr 30, 2014
I am creating a WinForm registration application and my program accepts user input information and stores it but I am struggling to use my login function. I believe there is an error in the area of cmd.Parameters.AddWithValue section, I dont think addwithvalue is correct ? I get a fatal crash has occurred when I click Login
string constring = "datasource=127.0.0.1;port=3306;username=root;password=welcome";
string Query = "SELECT * FROM 'userinfo'.'users' where 'username' = @userid and 'password' = @password)";
MySqlConnection conDatabase = new MySqlConnection(constring);
MySqlCommand cmd = new MySqlCommand(Query, conDatabase);
cmd.Parameters.AddWithValue("@userid", this.userid_txt.Text);
cmd.Parameters.AddWithValue("@passone", this.passone_txt.Text);
[code]....
Fixed the crash error, simple typo but now I am getting SQL Syntax errors which I originally believed I fixed.
View 1 Replies
View Related
Jan 3, 2015
I am working on binary files in turbo c++ 3.5 and i want to create a library program. I want to add information about books in a binary file and do functions such as: Search and replace, delete a record, and etc.
I do this functions but i have 2 problems: 1. For example when i add 6 records about books to file, BooksReport function cant show all records and for example just show 4 or 5 records and when i search records, from 5 records, for example i just found 3 or 2 records. 2.When i search and replace a word on file, all records thats before this edited record, will be deleted.
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void add();
void search();
struct {
char name[20];
[Code]...
View 2 Replies
View Related
Mar 10, 2014
I am writing a program that grabs information from a .dat file. I have the code all structured up, but I get these 2 errors that does not make any sense to me on how to fix the program.
errors (2):
Code:
Error1error LNK2019: unresolved external symbol "void __cdecl swap(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > *,class std::basic_string<char,struct std::char_traits<char>,
class std::allocator<char> > *)"
[Code] ....
Error2error LNK1120: 1 unresolved externalsC:UsersMomDesktopDriveQuarter 2C++ProjectsDynamicDeptPayrollDebugDynamicDeptPayroll.exeDynamicDeptPayroll
.dat file contents:
Code:
Fogarty Bob 1 40 10.25
Smith John 2 38 8.72
Jones Mary 2 28 6.25
Arrmen William 1 15 8.22
Lavey Betty 1 32 15.00
source contents:
Code:
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
//PROTOTYPES
void sort(int n);
void swap(string *p1, string *p2);
[Code] ....
View 2 Replies
View Related
Jan 10, 2014
How can I send information and receive from external command prompt from my program??. I want to run an external command prompt, a code that's is not mine, to send information to this command prompt, then make my program hit enter at the command prompt and then receive back information from the command prompt.
View 5 Replies
View Related
Jan 11, 2014
I'm reading from a file the middle column of data (Volts) where my test file "AP.txt" is opened by my program. Here is a segment of the data:
time Volts dV
49552 -66.20183 -0.01556807
49553 -67.76025 -0.01556495
49554 -69.30704 -0.01533247
49555 -70.81799 -0.0148486
49556 -72.26774 -0.0141133
49557 -73.63226 -0.01315276
49558 -74.89141 -0.01201764
Since the calculation I performed gives me -71.77 Volts, I need to match this value to the time that this occurs closest to using my program, and output the time that this occurs at.
Here is my program so far:
int main()
{
std::ifstream inFile;
inFile.open("AP.txt");
ofstream results_file ("maxvaluewithinput.txt");
float TimeAtdVMax = 0;
float VoltsAtdVmax = 0;
[Code]...
If you're curious, this program isn't for homework. It's part of the independent learning on C++ I'm doing for a Master's Thesis; the program will eventually model the APD90 of a ventricular action potential.
View 10 Replies
View Related
Dec 12, 2013
Here your supposed to create a program that takes in information and formats it into three columns.
I can't seem to use the float variable unitprice with decimal places here for, if I try to use %.1f and type in an input, the program seems to skip over the second scanf function, not allowing me to put input into the third scanf function as the program runs before I can.
I can use %f on its own and it works but this creates too many zeroes(and you're supposed to set the currency limit to $99999.99).
Code:
#include <stdio.h>
int main(void) {
int itemno, month, year, day;
float unitprice;
[Code]....
So the output should look like three columns. It's just the float that is the issue here....
View 5 Replies
View Related
Aug 15, 2013
Code to accept the information of 5 students and display the information of first 3 students......
Code:
#include<stdio.h>
main() {
struct stud {
char name[20];
int rollno;
float per;
char grade;
[Code] ....
View 6 Replies
View Related
Sep 29, 2013
I want to create a proper visible table with boundaries that contains boxes and each box receives a value .I don't know where to start from.i have an idea of using matrix for entering values in each box of table,but how to create lines and boundaries ?
View 1 Replies
View Related
Apr 10, 2013
I'm getting a error on my Circle::Circle(double radiusValue) constructor. My instructions is 'Add a constructor that accepts one argument and uses it to set the radius.'
#include <iostream>
#include <cmath>
using namespace std;
class Circle {
private:
double x;
double y;
double radius;
[Code] .....
View 3 Replies
View Related
May 5, 2014
How to go about making a function that accepts an integer and returns a string with any one of 5 strings containing the name of the object. For example object number 3 might be "Pen". Object 4 might be "Paper".
To do this would I just use an array?
View 4 Replies
View Related
Feb 12, 2014
Write a function that accepts an array of integers and its size as arguments. The function should create a new array that is one element larger than the argument array. The first element of the new array should be set to 0. Element 0 of the argument array should be copied to element 1 of the new array, element 1 of the argument array should be copied to element 2 of the new array, and so forth.
The function should return a pointer to the new array. Use ONLY pointer parameters instead of arrays in both functions; use pointers (not subscripts) to move through elements of both arrays. Before calling the function, display your original array. When the function call is completed, display the new array.
Here is what i got so far:
#include <iostream>
using namespace std;
int *shifted (int * , int);
const int SIZE = 10;
int main () {
int array_size [30];
[Code] ....
View 1 Replies
View Related
Nov 19, 2014
Write a template that accepts an argument and returns its absolute value. The absolute entered by the user, then return the total. The argument sent into the function should be the number of values the function is to read. Test the template in a simple driver program that sends values of various types as arguments and displays the results.
#include <iostream>
using namespace std;
template <class integertemplate>
integertemplate totalint (integertemplate integers) {
cout << "How many integer values do you wish to total? ";
cin >> integers;
[Code] .....
View 8 Replies
View Related
Feb 16, 2014
write a function accepts two arguments, an array of integers and a number indicating the number of elements in the array. the function should recursively calculate the sum of all the numbers in the array. Demonatrate the use of the functions in a program that asks the users to enter an array of numbers and prints it sum
i had done this but it wont work
#include <iostream>
#include <conio.h>
#include <iomanip>
using namespace std;
[Code].....
View 6 Replies
View Related
May 24, 2013
In this code:
// Ex10_15.cpp Using lambda expressions
#include <algorithm>
#include <iostream>
#include <iomanip>
[code].....
The lambda accepts no arguments, but it accesses increment by value and current by reference, the latter being used to store the next value to be set. This lambda has the side effect that current will be updated when generate is finished. The following lambda expression is similar, but without the side effect:
[=]()mutable->T{T result(current);
current += increment;
return result;}
"
I dont exactly understand what side affect it is talking about. Wouldn't you want generate to update current? I understand how the second code fixes it though, just takes everything in the enclosing scope by value.
View 2 Replies
View Related