[QUOTE=peter_budo;1770076]As forum rules clearly state - Do provide evidence of having done some work yourself if posting questions from school or work assignments

Above request is just "hey I have idea of project, do it for me" which doesn't work[/QUOTE]
The "project" was more on the idea stage. Kinda wanted to know how many ways this could be done, if it happened to be that there was some expert on the area. The reason so we were more clear on what we exactly wanted to do and how to engage it most efficient.

And no, its not "hey do my project". Nothing indicates that and it doesn't make any sense either. As you probably know a project is something big, so no sense that I would ask anyone to do it for us. Plus the methods and books we use... Weird accusation.

Anyways don't blame you, this is a coding forum, and should ask help on the codes(with own attempt) instead of "expertise" on something that not many can share.

peter_budo commented: For down voting my reply -4

delete

Greetings all been a while since I last posted. Let me explain what I need help for..
I want an Android App where you can watch livestream /screenshots from a placed camera in a store. You can already watch the cameras filming on a computer.

We have some assumptions on how we want it done but we are not 100% sure. Since we need to document everything for this school project, I need some help on how this could be done. Hope someone can help, best regards.

It does not work like that, in C++ its automatic its not like that with this complier... Nvm found a guide, thread solved

People get dumber by the days that goes by.. More enjoyable to get d..k from 20 men a day? I dont buy that.

Just wondered how to /save projects and files in sml. I use sml/nj complier.. After I write some code for instance, I dont know how to save it like you do in C++ or other languages. Hope someone understands and can help me out :)

[QUOTE=jonsca;1452048]Yes, what we have described to you will fulfill the requirements of the assignment. Which part are you still stuck on?[/QUOTE]
Im stuck with making the program terminate when entered 0. And im stuck at the part so the program will ask for another cin after the program gives the first cumulative numbers. The program asking for another cin after it calculated the first have to be infinite.. Only when I press 0 then the program have to terminate.. Logical operators as &&, || are not allowed. It has to be done with Do-While loop, While-loop or for loop. Expression like ==, =>, !=numbers etc are allowed since its in the chapter for the assignment...

The assignment is from C++ Primer Plus. I find the book easy and understandble but with that said some of the assignents are tricky..

M8 the next chapter is about if statments... It have to be done with a do-while, while or for loop.. Without logical expression as &&.. !0=, ==, => things is fine, cause its in the chapter with the assignment... Thanks for the help though...

[QUOTE=jonsca;1451985]Where did the number 100 come from in the first place? Your best bet is a do/while loop.

If the number is not zero, the while condition will be true, and the program will loop again. Putting it in the do/while form guarantees that the program will prompt for the number at least once.[/QUOTE]
Thats is another thing.. You are right about the 100, I didnt know how to do it else... Here is the assignment description.

"Write a program that asks the user to type in numbers. After each entry, the program should report the cumulative sum of the entries to date. The program should terminate when the user enters 0."

[QUOTE=alaa sam;1451570]you can use a while loop to make it terminates when the user enters 0 also you need to read the numbers from the user in the loop
[CODE]
int i=0;
while(numbers!=0 && i<100)
{
cout << "Enter numbers: ";
cin >> numbers;
i=i+numbers;

}

[/CODE][/QUOTE]

It is forbidden to use the && operator in this chapter, plus the program must not terminate, it must keep asking for a "cin" after it calcalutes the previous cumulative numbers... Then I shall be able to use 0 to terminate it when I want. I hope someone can help me out with this problem..

The assignment says "Write a program that asks the user to type in numbers. After each entry, the program should report the cumulative sum of the entries to date. The program should terminate when the user enters 0."

I have partly been succesfull I guess. But I dont know how to make the program so it doesnt quit when I press the first number. And for it to actually quit when I press 0.. I hope a friendly soul can help me out.

[CODE]

include

using namespace std;

int main()
{

int numbers = 0;

cout << "Enter numbers: ";
cin >> numbers;

for (int i=0; i<100;i=i+numbers){

cout << i;

}

cin.get();
cin.get();
return 0;

}
[/CODE]

Thread solved. I figured it out with a little help. Thx guys for taking the time

No the code runs... I use visual studio 2010.. Is that a problem in other ides?

Lol. Im a beginner though, I deleted the old code since I got infinite loops.. This is the code I have now, im not sure to make nested for loop or if im even in the right track.. Please bear with me :)

[CODE]#include

using namespace std;

int main(){

int first = 0;
int second = 0;
int value = first + second;

cout << "Enter first Integer: ";
cin >> first;
cout << "Enter second Integer: ";
cin >> second;

for (int first = 0; first < second; first + second, first++){

cout << "value of the entered numbers" <<" :"<< first <<endl;

}

cin.get();
cin.get();
return 0;
}[/CODE]

Im not sure to use an array yet to look for the next number and plus it. I cant express it in code, its probally simple but I cant see it. Yet

The question is "write a program that request the user to enter two integers. The program should then calculate and report the sum of all the integers between and including the two integers. At this point, assume that the smaller integer is entered first. For example, if the user enters 2 and 9, the program should report the sum of all the integers from 2 through 9 is 44."

I have to use 2 integers, a for loop etc.. I just dont know how to make this program as smalles as posibile without making an array for instance, I hope someone can help me with this if possible.

Ok ty guys... Thread solved

Wow m8 thats seems a bit too advanced for me :D. I appreciate your time and help no doubt. But im sure it can be done much more simple.. Or maybe it cannot?

I need help with this problem. The assignment says: "Do programming Exercise 6, but instead of declaring an array of three CandyBar structure, use new to allocate the array dynamically".

Here is assignment 6:

[CODE]#include

using namespace std;

struct CandyBar {

char candyName[25];
double candyAmount;
int twoCandyWeight;

};

int main(){

CandyBar detailOfCandy[3] = {
{"Donkey",
2.5,
200},

{"Monkey", 4.4, 100},

{"Honkey", 3.3, 50}

};

cout << "First CandyBar: " << detailOfCandy[0].candyName << "Second CandyBar: "<<detailOfCandy[1].candyName <<" Third CandyBar: " 
<< detailOfCandy[2].candyName;

cin.get();
cin.get();
return 0;
}[/CODE]

How do I make this happend without ruinning all that "beautifull code"? Or atleast give me direction/explation for it please :). Hope someone can help me

Thx alot arkonig, swineflue and eslimo, I apreciate it alot :). Helped clearing some of the concepts I didnt understand.

Thx alot guys :)

[QUOTE=jonsca;1414819]You're close - you need [icode]cin.getline()[/icode] (you have the parameters basically correct) to take in the whole line.

Try the following test program to see if it helps you understand the other part of the problem:

[code]
char x = 'a';
char y = 'd';
char z = '9';

std::cout << y - x<<std::endl;
std::cout << ++y <<std::endl;
std::cout << z - '0' <<std::endl;
[/code]

Test different values of the letters and look at [url]http://web.cs.mun.ca/~michael/c/ascii-table.html[/url] for reference.[/QUOTE]
Thx alot m8 I try it out tonight after some work.

[QUOTE=jonsca;1414602][code]
What is your first name? Jim Bob
What is your last name? What letter grade do you deserve? C
What is your age? 100
Name: Jim, Bob
Grade: C
Age: 100
[/code]

It's not working fine when I enter a first name with a space, it skips over the last name prompt completely. Hint, you can't use cin when you have a space as it uses a space as a marker to stop taking in characters.

WaltP has given you an important clue. First you need to modify your array approach, as it's unnecessary. Take in a regular char. A char is a 1-byte integer, and therefore you can perform arithmetic on it.[/QUOTE] I figured I should use cin.get().get(); with the problem you stated, still havent figured the arithemetic..

Here is the new code:[CODE]#include

using namespace std;

int main(){

char firstName[20];
char lastName[20];
char letterGrade[6];
int whatAge;

cout << "What is your first name? ";

cin.get(lastName, 20).get();

cout << "What is your last name? ";
cin >> firstName;

cout << "What letter grade do you deserve? ";
cin >> letterGrade;

cout << "What is your age? ";
cin >> whatAge;

cout << "Name: "<< lastName<< ", "<< firstName<<endl;
;
cout << "Grade: "<< letterGrade<<endl;
cout <<"Age: " << whatAge;

cin.get();
cin.get();
return 0;
}[/CODE]

deleted

[QUOTE=jonsca;1414602][code]
What is your first name? Jim Bob
What is your last name? What letter grade do you deserve? C
What is your age? 100
Name: Jim, Bob
Grade: C
Age: 100
[/code]

It's not working fine when I enter a first name with a space, it skips over the last name prompt completely. Hint, you can't use cin when you have a space as it uses a space as a marker to stop taking in characters.

WaltP has given you an important clue. First you need to modify your array approach, as it's unnecessary. Take in a regular char. A char is a 1-byte integer, and therefore you can perform arithmetic on it.[/QUOTE]

Thats the thing I dont know how to write the code for Char Array arithemetic subtraction. If there is a guide on the internet please post it I will read it and do from that.. I have just realized the other problem when want to show 2 names on the same line.. I dont want the code for it, just maybe some direction and toturial that specific shows/explains these problems. Ty for the input guys

[QUOTE=jonsca;1414557]The prompts are reversed for first and last name.

Also, test your program with a two word first name (like Betty Sue) and see what happens...[/QUOTE]
That part works fine... The problem is the Grade thing.. When you input for instance C it should decrease by one and show D..

[QUOTE=WaltP;1414555]Simply add one.

A [I]char[/I] is simply a number output in a special way. B is the value 66, C is 67.[/QUOTE]
Can you explain more further in terms of code example. Im pretty new to programming and havent fully grasped arrays at all...

The assigment sounds like this : Write a C++ program that request and displays information as show in the following example of out:

What is your first name? Betty Sue
What is your last name? Yew
What letter of grade do you deserve? B
What is your age? 22
Name: Yew, Betty Sue
Grade: C
Age: 22

Here is my code for it... I dont know how to decrease the Char by one since you input Grade B, it should output C. Here is my code so far, hope someone can help me out :)

[CODE]#include

using namespace std;

int main(){

char firstName[20];
char lastName[20];
char letterGrade[] = "ABCDF";
int whatAge;

cout << "What is your first name? ";
cin >> lastName;

cout << "What is your last name? ";
cin >> firstName;

cout << "What letter grade do you deserve? ";
cin >> letterGrade;

cout << "What is your age? ";
cin >> whatAge;

cout << "Name: "<< lastName<< ", "<< firstName<<endl;
cout << "Grade: "<< letterGrade<<endl;
cout <<"Age: " << whatAge;

cin.get();
cin.get();
return 0;
}[/CODE]

[QUOTE=swinefish;1414223]I did functional programming first semester this year, and we also did SML... don't know anything about MatLab, but I'll answer everything I can.

arkoenig was right in what he told you about values never changing, it's very different to what we usually use. However SML has implemented certain kinds of loops since they can be changed into recursion.

Really what it comes down to is that you use a lot of recursion rather than iteration - functions will call themselves over and over, as you can see in arkoenig's code. Now for your questions...

1) Functional programming can be used for anything that 'traditional' programming can be used for, it has the same capabilities. I don't know if functional languages usually support user interfaces, but other than that they're incredibly powerful, as well as very elegant.

2) Well you'll be taught how to use it of course, but basically everything you do must be turned into a function. You have no global variables, and you have a very limited set of operations. But in spite of that it's very powerful, and a joy to work with once you understand it.

3) You can make apps with it, although you will often make the front-end (User interface etc.) in something else, and link through to your functional to compute results. Why? Functional languages tend to be very fast, and the use of functions makes them very easy to debug as well.

4) No, it is not purely theoretical, although you ...

Fair enough ty for the reply but what is it used for specifc .. Is the language supportive for other languages...

And by Matlab I meant that if Matlab is also Functional Language or/and what is Matlab used for.
Im sry maybe my logic isnt good but I need very cut out specific answers... In human language lol :)

Hello everyone, im starting on computer science the coming summer. I checked our classes schedule and we start of by Functional Programming in SML. I download the book we gonna use but I cant make sense of it.

I guess my question is what do you use 1.Functinal programming for, 2. how do you use it, 3. can you make programs/Apps in it like you can in C++ or 4. is it pure teoratical stuff??

  1. How does MatLab differe from SML, or 6. are they completely 2 different tools that got nothing to do with each other.. I hope a friendly soul can help me out :)

Best regards