TRENDING NEWS

POPULAR NEWS

C Programming Trouble

C++ Programming Trouble?

I have to write a program that does a few things with the Lucas sequence(It's basically the exact same thing as fibonacci except it doesn't start at 0). Anyways I am trying to write the 3rd option which should give a summation of all the lucas numbers up to the bound the user gives, so if they input 23 it will add up all the lucas numbers up to 23. I think I am on the right track but I am not 100% sure. Anyways it keeps giving me an error that says "statement cannot resolve address of overload function". I would love some help. Here is the part of the code I am stuck at.

else if (choice == 3) {
int a=2;
int b=1;
int c=3;
int bound, sum;
cout << "Plese enter the upper bound of the summation you are looking for:";
cin>>bound;
if (bound< 0) cout << "Only Posiive Numbers are accepted\n\n";
else{
while (c {
a=b;
b=c;
c=a+b;
sum=sum+c;
}
cout << sum << " is the summation of all numbers until " << bound << endl;endl;
} }

C programming trouble!! Pls help me.. T_T?

Hello! I'm Matt 17 yrs old and im a 2nd yr college student. Im currently taking up a course on Information Technology. I need a little help with programming problems my instructor gave to me. I can't do this alone and i need some little help. The problems are listed below...pls help me guys.... pls?..

1. Write a program to create a multiplication table for all combinations of two numbers from 1 to 8.

Variables
Multiplier
Multiplicand

Output

1 2 3 4 5 6 7 8

1 1 2 3 4 5 6 7 8
2 2 4 6 8 10 12 14 16
3 3 6 9 12 15 18 21 24
4 4 8 12 16 20 24 28 32
5 5 10 15 20 25 30 35 40
6 6 12 18 24 30 36 42 48
7 7 14 21 28 35 42 49 56
8 8 16 24 32 40 48 56 64

2. Write a program to produce the following output. Use nested for loops.

Output

1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
1 2 3 4 5 6
1 2 3 4 5 6 7
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7
1 2 3 4 5 6
1 2 3 4 5
1 2 3 4
1 2 3
1 2
1

3.Write a program to assign grade points according to a letter score. An A is 4 grade points; B is 3; C is 2; D is 1; and F is 0. Use the else if construct.

Variables
grade
grade_points

Output
Letter grade: B
Grade point: 3

Letter grade: D
Grade point: 1



4.The Ace Courier Service charges $10 for the first pound or fraction thereof and $6 per pound for anything over one pound. Write a program that figures the charges.


Variables
weight

Output
WEIGHT: .7
CHARGE: 10

WEIGHT: 2.5
CHARGE: 19

WEIGHT: 4.2
CHARGE: 29.2

pls help me guys... just solve even one of this problems so i can review it properly.... huhuhuhu

(btw im using my mom's email address coz mine cant access yahoo answer i dunno why....)

Im having trouble with this program!!!? C++?

Write a program that takes its input from a file of numbers of type double. The
program outputs to the screen and the output file, outfile.txt, including all input
values, and the average and standard deviation of the numbers in the file with
the appropriate format for the double type numbers. The file contains nothing but
numbers of type double separated by blanks and/or line breaks. The standard
deviation of a list of numbers n1, n2, n3, and so on forth is defined as the squared
root of the average of the following numbers:
(n1 – a)2, (n2 – a) 2, (n3 – a) 2, and so on forth.
The number a is the average of the numbers n1, n2, n3, and so forth.
In the main program, you must use the function calls only.
Use the attaché file, infile.txt, as an input file for the program.

HINT: write a program so that it first reads the entire file and computes the

average of all the numbers, and then closes the file, then reopens the file and
computes the standard deviation.

I am new to C programming and i am having trouble with my homework can anybody help?

Here is the question


Write a program that can serve as a simple calculator. This calculator keeps track of a single number (of type double) that is called result and that starts out as 0.0. Each cycle allows the user to repeatedly add, subtract, multiply, or divide by a second number. The result of one of these operations becomes the new value of result. The calculation ends when the user enters the letter R for “result” (either in uppercase or lowercase). The user is allowed to do another calculation from the beginning as often as he or she wants. Use the scanf for input.

The input format is shown in the following sample dialog. If the user enters any operator symbol other than +, −, *, or /, then display message “UnknownOperatorException is thrown “ and the user is asked to reenter that line of input..

this is a sample:
Calculator is on.
result = 0.0
+5
result + 5.0 = 5.0
new result = 5.0
*2.2
result * 2.2 = 11.0
updated result = 11.0
% 10
% is an unknown operation
Reenter, your last line:
* 0.1
result * 0.1 = 1.1
uptdated result = 1.1
r
Final result = 1.1
Again? (y/n)
yes
result = 0.0
+10
result + 10.0 =10.0
new result = 10.0
/2
result / 2.0 = 5.0
updated result = 5.0
r
Final result = 5.0
Again? (y/n)
N
End of Program

Having a bit of trouble with this C++ program?

Write an application where you ask the user to input the price per letter (PPL), and then ask the user to input the sentence they want printed. The application should then calculate the number of letters and give the user the total cost in the following manner: You have 40 letters at $3.45 per letter, and your total is $138.00. Your application should only use "FOR" loops. Do not use any String or Array functions.

I'm stuck when it comes to the last half of this problem.

#include "stdafx.h"
#include
using namespace std;


int main()
{
//Ask the user to input price per letter
double pricePerLetter;
cout << "What is the price per letter?" << endl;
cin >> pricePerLetter;

//Ask the user to input the sentence they want printed
cout << "Please enter the sentence you want printed, press '*' to finish" << endl;
for (char Letter; Letter != '*';)
{
Letter = std::getchar();
//find a way to count only letters in order to find PPL

}

return 0;
}

My strongest programming language is C. But I am having trouble finding a job looking for that language. What are some good careers?

C is the language used most often for programming systems. Like operating systems (e.g., Unix/Linux/Whateverix). And embedded systems. The computers in things that have one or more computers, but are not themselves computers. Everything from your microwave oven, to your car, to a pacemaker, or even your PC keyboard.C is used because it has less abstraction, and provides greater control of the constrained resources such systems generally have. Of course, that means you will need to have some domain knowledge, and some comfort dealing with hardware at a low level. Reading datasheets and schematics, understanding timing and interrupts. And what const and volatile really mean.Also things like communications protocols, from RS-232 and CAN to SDLC and UDP and TCP/IP.But if you’re up for the challenge, just look for jobs for embedded systems or device driver programmers. There is still significant demand for people with these skills.

I've used turbo c++ for programming. I'm having trouble using visual studio c++, mainly due to different commands. How can I improve?

I don’t understand your problem. Both are IDE’s that compile C++ code so code that works in Turbo C++ should also work in Visual Studio. There’s a slight difference in the project files but if you use C++ correctly then you should not have any big problems.So your problem could be the IDE itself. Well, that’s basically a matter of learning the new shortcut keys. So, F5 instead of F9 to compile, for example. It’s how the IDE works and has nothing to do with C++.Or your problem is with third-party companies as Turbo C++ has the Visual Component Library and Visual Studio has other libraries for making windowed applications with buttons and stuff. That’s also challenging but still a matter of practice.So, something is preventing you from liking Visual Studio. You’ve gotten used to the Turbo IDE. Normally, people just adjust to the new IDE but it sounds to me that there’s some dislike to the Visual Studio IDE. That could be your problem?How to solve it? Either start liking Visual Studio or start using another IDE. There are many other options…

C programming , Fscanf and fprinf?

Consider the following example:

FILE *f1; //DECLARED FILE POINTER f1
int a=2,b;
char w='p',x;
float f=34,g;

f1=fopen("a.txt","w+"); //OPENING FILE FOR WRITING (w)

fprintf(f1,"%d %c %f",a,w,f); // VARIABLES a w f CORRESPOND TO THE FORMAT
//SPECIFIERS %d %c %f

//VALUES OF a,w,f WILL BE PRINTED IN THE FILE a.txt

fscanf(f1,"%d %c %f", &b,&x,&g); //ASSIGNED VALUES FROM FILE a.txt TO b,x,g
// &b,&x, &g ARE ADDRESSES

Here in the above example, the fprintf prints the values of a, w, f in the file a.txt which is opened by
the file pointer f1. Instead, a simple printf function is used to print to the standard output device,
i.e, the monitor.
Similarly, the fscanf function scans values from the file a.txt opened by file pointer f1 and assigns them to b,x,g. Instead, a simple scanf function is used to scan the values entered from the standard
input device i.e, the keyboard.
THAT'S THE DIFFERENCE !!!!

TRENDING NEWS