| Q. | Programming & Design? | Related Search: Programming & Design | | | i want to design a program but having unexpected errors ..i am beginner. please guide me for the following program.. and please be-patient.i really don't know what my mistakes are.
#include<iostream.h>
#include<conio.h>
#include <math.h>
main()
{
char opt;
int a,s,m,l,q;
float a1,a2,b1,b2,d,e;
opt='y';
do
{
cout << " Math Menu " << endl;
cout << " __________ " << endl;
cout << " Press 'a' to add two vectors" << endl;
cout << " Press 's' to subtract two vectors" << endl;
cout << " Press 'm' to multiply two vectors" << endl;
cout << " Press 'l to calculate the length of vector " << endl;
cout << " Press 'q' to quit " << endl;
cout << "------------ " << endl;
cout << "Please enter your choice:";
cin >> opt;
while(opt=='a')
{
cout << "Enter first component of vector :";
cin >> a1;
cout << "Enter second component of vector :";
cin >> b1;
cout<<"The vector is :"<<"["<<a1<<","<<b1<<"]"<<endl
cout << "Enter first component of second vector :";
cin >> a2;
cout << "Enter second component of second vector :";
cin >> b2;
cout<<"The vector is :"<<"["<<a2<<","<<b2<<"]"<<endl
c=a1+a2;
d=b1+b2;
cout << "The sum is :"<<"["<<c<<","<<d<<"]"<<endl;
cout << "Press any key....." << endl;
opt='y';
getch();
}
while(opt=='s')
{
cout << "Enter first component of vector :";
cin >> a1;
cout << "Enter second component of vector :";
cin >> b1;
cout<<"The vector is :"<<"["<<a1<<","<<b1<<"]"<<endl
cout << "Enter first component of second vector : ";
cin >> a2;
cout << "Enter second component of second vector : ";
cin >> b2;
cout<<"The vector is :"<<"["<<a2<<","<<b2<<"]"<<endl
c=a1-a2;
d=b1-b2;
cout << "The difference is :"<<"["<<c<<","<<d<<"]"<<endl;
cout << "Press any key....." << endl;
opt='y';
getch();
}
while(opt=='m')
{
cout << "Enter first component of vector :";
cin >> a1;
cout << "Enter second component of vector :";
cin >> b1;
cout<<"The vector is :"<<"["<<a1<<","<<b1<<"]"<<endl
cout << "Enter first component of second vector :";
cin >> a2;
cout << "Enter second component of second vector :";
cin >> b2;
cout<<"The vector is :"<<"["<<a2<<","<<b2<<"]"<<endl
c=a1*a2;
d=b1*b2;
e=c+d
cout << "The multiplication is:"<<"["<<e<<"]"<<endl;
cout << "Press any key....." << endl;
opt='y';
getch();
}
while(opt=='l')
{
cout << "Enter first component of vector :";
cin >> a1;
cout << "Enter second component of vector :";
cin >> b1;
c=a1*a1+b1*b1
e=sqrt (c)
cout << "The length is:"<<"["<<c<<"]"<< endl;
cout << "Press any key....." << endl;
opt='y';
getch();
}
if(opt=='q')
return 0;
else();
}
cout << "You have entered wrong choice:" << endl;
opt='y';
getch();
{
}
while(opt=='y');
}
Error: vectors.cpp(33,7):Statement missing ;
Error: vectors.cpp(38,4):Statement missing ;
Error: vectors.cpp(40,33):Undefined symbol 'c'
Error: vectors.cpp(52,7):Statement missing ;
Error: vectors.cpp(57,4):Statement missing ;
Error: vectors.cpp(71,7):Statement missing ;
Error: vectors.cpp(76,4):Statement missing ;
Error: vectors.cpp(79,7):Statement missing ;
Error: vectors.cpp(91,18):Statement missing ;
Error: vectors.cpp(99,13):Expression syntax
Error: vectors.cpp(101,11):do statement must have while
Warn : vectors.cpp(107,20):Code has no effect
Warn : vectors.cpp(109,2):'e' is declared but never used
Warn : vectors.cpp(109,2):'d' is assigned a value that is never used
Warn : vectors.cpp(109,2):'q' is declared but never used
Warn : vectors.cpp(109,2):'l' is declared but never used
Warn : vectors.cpp(109,2):'m' is declared but never used
Warn : vectors.cpp(109,2):'s' is declared but never used
Warn : vectors.cpp(109,2):'a' is declared but never used
in using borland
the point is, i want to create a program in c++ using do while operations for addition/subtraction/multiplication/length of the declared values in vector form
e.g
vector1 [1,2]
vector2 [2,3]
addition is [3,5]
subtraction is [-1,-1]
multiplication is 8
length of vector is 2.83
(length calculated by using Pythagoras theorem)
1-how to add limitation of entering only one character for respective values
e.g...for vector values the values should be in numeric and for menu the characters should be in alphabets.if the user don't follow the rules the the there should be a message for the user.not like getting in infinite loop [like now]......
| | A. | Adding further:
You can implement different C++ functions as well your own logic for validation check. Please see the following links to have an idea as to input validations so that you can grasp the idea and can build the validation on your own.
[Link]
[Link]
[Link]
[Link]
---------------------------------------
Your program has some minor syntactical errors and few logical. Please find bellow the corrected one. Hope this helps.
Cheers!
-----
#include<iostream.h>
#include<conio.h>
#include <math.h>
#include<stdlib.h>
void main(void)
{
char opt;
int a,s,m,l,q;
float a1,a2,b1,b2,c,d,e;
do
{
system("cls");
cout << " Math Menu " << endl;
cout << " __________ " << endl;
cout << " Press 'a' to add two vectors" << endl;
cout << " Press 's' to subtract two vectors" << endl;
cout << " Press 'm' to multiply two vectors" << endl;
cout << " Press 'l to calculate the length of vector " << endl;
cout << " Press 'q' to quit " << endl;
cout << "------------ " << endl;
cout << "Please enter your choice:";
cin >> opt;
if(opt=='a')
{
cout << "Enter first component of vector :";
cin >> a1;
cout << "Enter second component of vector :";
cin >> b1;
cout<<"The vector is :"<<"["<<a1<<","<<b1<<"]"<<endl;
cout << "Enter first component of second vector :";
cin >> a2;
cout << "Enter second component of second vector :";
cin >> b2;
cout<<"The vector is :"<<"["<<a2<<","<<b2<<"]"<<endl;
c=a1+a2;
d=b1+b2;
cout << "The sum is :"<<"["<<c<<","<<d<<"]"<<endl;
cout << "Press any key....." << endl;
getch();
}
else if(opt=='s')
{
cout << "Enter first component of vector :";
cin >> a1;
cout << "Enter second component of vector :";
cin >> b1;
cout<<"The vector is :"<<"["<<a1<<","<<b1<<"]"<<endl;
cout << "Enter first component of second vector : ";
cin >> a2;
cout << "Enter second component of second vector : ";
cin >> b2;
cout<<"The vector is :"<<"["<<a2<<","<<b2<<"]"<<endl;
c=a1-a2;
d=b1-b2;
cout << "The difference is :"<<"["<<c<<","<<d<<"]"<<endl;
cout << "Press any key....." << endl;
getch();
}
else if(opt=='m')
{
cout << "Enter first component of vector :";
cin >> a1;
cout << "Enter second component of vector :";
cin >> b1;
cout<<"The vector is :"<<"["<<a1<<","<<b1<<"]"<<endl;
cout << "Enter first component of second vector :";
cin >> a2;
cout << "Enter second component of second vector :";
cin >> b2;
cout<<"The vector is :"<<"["<<a2<<","<<b2<<"]"<<endl;
c=a1*a2;
d=b1*b2;
e=c+d;
cout << "The multiplication is:"<<"["<<e<<"]"<<endl;
getch();
}
else if(opt=='l')
{
cout << "Enter first component of vector :";
cin >> a1;
cout << "Enter second component of vector :";
cin >> b1;
c=a1*a1+b1*b1;
e=sqrt(c);
cout << "The length is:"<<"["<<c<<"]"<< endl;
getch();
}
else
{
if(opt !='q')
{
cout << "You have entered wrong choice. Press any key....." << endl;
getch();
}
}
}while(opt!='q');
} | | | |
| Q. | Is there a college in New York that provides Game programming or Game design? | Related Search: Higher Education (University ) | | | Im really interested in game simulation, programming, design, etc. Any study would be fine, as long as it still relates to gaming.
Im searching the web like mad for colleges in New york that provides Game programming and simulation courses. Im looking for courses that allows me to get a B.A.
| | A. | you might end up in a 'game design' program that was tossed together hastily, if you end up at one of the for-profit schools.
you will end up with a BS or a BFA most likely, not a BA.
This is one of those fields that seems sexy and exciting, but usually when I question young people interested in it, they cannot tell me where the jobs are, or what is the biggest potential market sector that will use games. They all know Warcraft, and all the other FPS hack and slash games, and think that that is the extent of game design.
and dont misunderstand, it will be a huge field, but you will take English, history, and a bunch of other 'unrelated' courses. you need excellent critical reasoning skills, math, and familiarity with art and even physics to be a good overall game designer.
good luck, but I dont think that there are too many good game design programs in NY state. | | | |
| Q. | How i can start myself a game programming and design team? | Related Search: Programming & Design | | | Please give me some basics steps.
Just like in how many and what parts i should divide my team.
(one for 3d design\1 for audio recording\1 for programming)
How i can sell my first game?
I think you all got the point so please help me!
Thanks!
| | A. | First of all, like the other answerer said, do get to know your team but you can find qualified people on game programming forums, you just have to recognize those mature enough to actually stick with it and like your game idea. So throw out a game idea and see who bites.
Who you get for your team and how many are all dependent on what your game is. If you are new to games, you can probably get away with a 3-4 person team made up of an interface designer, 2D designer, someone for music and a couple programmers (programmers should really belong in teams to be useful). Those are teams for a simple 2D game which can be just as fun... take Little Fighter 2 over at [Link] . It is 2D and been around for years and still very popular and fun to play.
If you are going for a 3D 1st person shooter or RPG you may want to beef up the team with a couple of 3D programmers, a game level designer, interface designer, and as many fluent programmers you can in the language you choose to make the game.
Once you have assembled a decent sized team, you break the game into tasks and assign tasks to each part of the team. Make sure they talk to one another on a regular basis and that everyone is buying into the vision of the game you have laid out.
Once you have a somewhat functional game, put it through harsh tests using some beta testers. You can have friends test it out and tell you what you think, but you should probably have a good qualified beta tester too if you can.
Fix everything up that is wrong and then throw a demo on a site like [Link] as well as a few gaming sites. Also push it with a publisher using a sales person or you and your team. Generate some buzz.
If you are lucky and a lot of people like your game, you will start finding people wanting to buy. Once you are at this level, expand your team to include some technical support (by way of a web board and maybe phone if you have the capital).
Hope that helps answer your question and good luck with the game. I can't wait to play it. | | | |
| Q. | What are web design programming steps starting with HTML? | Related Search: Programming & Design | | | I'm studying web design and I would like to know the stages to knowing what you will ultimately need to know when entering this profession. With HTML being the step one and the basics, to I think XHTML and Css, being two, what's next? JavaScript? MySQL? Can some one provide an ordered list of web site programing from star to almost finish?
| | A. | You specifically said web *design*, so:
1. General design and layout - that means knowing how to use a pencil and paper to draw up a design, indeed.
2. HTML/XHTML
3. CSS/XML/XLST
4. JavaScript
And maybe
5. Server-side scripting (PHP, ASP, Perl - in order of popularity)
6. Database Management (MySQL, SQL, PostGres)
If you're talking about web *development*, then it's a slightly different list:
1. HTML/XHTML
2. XML
3. Server side scripting (PHP, ASP, Perl)
4. Database Management (MySQL, SQL, PostGres)
5. Client side Scripting (JavaScript, or VBScript in a controlled, Internet Explorer-only environment)
6. XSS/XLST
7. Basic layout and design
The difference between a web *designer* and a web *developer* is that - ideally - a web designer should need no knowledge of the intricacies of scripting and programming (or even CSS, for that matter, other than realizing what is and isn't possible).
It's the web *developer's* job to make a design work. | | | |
| Q. | What Kind of Job can I get with an Associates in Applied Sciences for Multimedia Programming and Design? | Related Search: Technology | | | My major is Multimedia programming and design. I am going for my associates. What kind of job(title) or career can I get within this discipline?
Serious answers only please! 10pts best answer
| | A. | Doesn't your school have some career counseling information? Ask your instructors for suggestions. | | | |
| Q. | What hardware should I include for a Game Design/Programming computer? | Related Search: Desktops | | | I need a computer that can handle Game Design & Programming, but I don't know what hardware the computer should have regarding HD space, memory, processor speed, video & sound cards? Also, what brand name should I trust? Overall, I'm wondering what brands & hard ware would best suit my needs. I saw an HP Pavillion Media Center Desktop (Intel Core 2 Quad Processor Q6600, 3 GB RAM, 640 GB Hard Drive) for just under $1200 (on Amazon). I'm not sure if this is overkill or if the Quad Processor fits my needs - or will a Dual Core will be enough - I don't want something that'll cause delays as I try to test games I design & my husband feels a HD with 250 GB's is more than enough. Any help? I refuse to use Dell's, I've had terrible experiences w/them. I am on a budget, which makes a package system that's upgradable seems the best route to me. I'd like it to last for at least three years without dying on me. Advice would be greatly appreciated. Thank you!
Yes, I'm taking classes to learn how to design/program games. We're taught in either Visual Basic, C++ or C# (we have to choose which one we wish to excell in) - we're also taught MMORPG, first person modification with the Unreal engine, simulation design and AI design/programming. Anything else I'm not 100% on so I'd rather not say and find out I didn't need a part of a computer for it, or I did. I'm just starting out, and I'm taking classes online so my programs are done via virtual computing (?) - I login to another computer through the internet and can launch a program like Visual basic and program and test it via that computer - forget what it's called. But I also want to be able to purchase the programs through my college inexpensively to make my own games too and test them. I have an RPG I'd like to work on so programs like 3D modelers I'll be using as well (that I already know how to do). I appreciate the input so far, thanks :)
btw, I play games, but I'm kinda new to the whole creating games, So I'm not sure what DX10 games are. I used to build computers but the newer technology has surpassed me now. I'm 32 but still consider myself computer savvy, the lingo still get's me a little confused once in a while though. The buying hard drive space cheap makes sense, I've seen HD space cheap lately too. My only question is what is a good brand that is reliable that will let me swap out the HD? Dell was a nightmare to swap things around. Like Video Cards, sound cards, forget HD space - my current dell while four years old, was still sent out with a VGA video card which shocked me. I don't want to end up in that situation again. I really want to be able to switch and change things around as much as I like. I like the idea of how a lightscribe burner lets you burn labels right onto the disk too, is it worth the price? I haven't checked the price differences lately.
| | A. | Buy the maximum kind of computer that you can afford in order to be as ready for the future as you can. Maximum RAM, maximum processor, maximum hard drive space, and buy an external hard drive and a CD/DVD burner to store and send your game designs. Buy directly from the manufacturer on-line to ensure that you have the full warranty on your system. Make certain that you are using Vista on your new PC, as XP will eventually get phased out and lose Microsoft support just like all of the older versions of Windows. | | | |
| Q. | Software Programming Design patterns - Does Template method need to be in an Abstract class? | Related Search: Programming & Design | | | Programming language - Java
I've got a class with a method which its algorithm i do not want to change.
I make that method final so the method can't change or overriden.
Does this count as a template method?
| | A. | No. Sorry it does not. In Template Method, the base class has an algorithm, which is broken into steps. The steps are private abstract methods so that derived classes can provide the details.
Consider a "Happy Meal" It's algorithm is an entree, side order, drink and toy. The entree could be burger, cheese burger or chicken nuggets. The side could be fries, apple slices or cookie. The toy varies ever week.
The "Happy Meal" algorithm never changes, but it's implementation may. | | | |
|
|