Friday, July 31, 2009

Program in C using arrays to store a 10 integer data and find the second smallest and second largest element?

//assuming that your array is in array[10]





int max,min;


int smax,smin;


int c;


max=min=array[0];


smax=smin=max;


for(c=0;c%26lt;10;c++)


{


if(max%26lt;array[c]) max=array[c];


if(min%26gt;array[c]) min=array[c];


}


for(c=0;c%26lt;10;c++)


{


if(smax%26lt;array[c] %26amp;%26amp; array[c]%26lt;max) smax=array[c];


if(smin%26gt;array[c] %26amp;%26amp; array[c]%26gt;min) smin=array[c];


}

Program in C using arrays to store a 10 integer data and find the second smallest and second largest element?
The simplest way to do this, is to sort the array and then select the 2nd and 2nd last elements. How exactly you would do this, depends on what sorting algorithms you know, and as I'm guessing this is from a Computing I course, you will have probably just learned some. The pseudocode looks like this





void problem(int numbers[], int size) {


sort (numbers,size);


printf("%d,%d\n",numbers[1],numbers[size...


}


C Programming Language: Using Recursion to Print the Fibonacci Series?

The Fibonacci series





0, 1, 1, 2, 3, 5, 8, 13, 21, …..





begins with the terms 0 and 1 and has the property that each succeeding term is the sum of the two preceding terms.





For this problem, we are asked to write a recursive function fib(n) that calculates the nth Fibonacci number. Recursion MUST be used.





In an earlier problem, we where asked to do the exact same thing, except we where to NOT use recursion. For that problem, I used the following code (between the dotted lines):





--------------------------------------...





main()


{


int c=1,f=0,s=1;


int i;


printf("%d%20d\n",f,f);


printf("%d%20d\n",s,s);


for (i=2; i%26lt;5||f%26lt;s; i++)


{


c=f+s;


f=s;


s=c;


printf("%d%20d\n",i,c);


}


}





--------------------------------------...





Which gave the correct output:








0 0


1 1


2 1


3 2


4 3


5 5


6 8


7 13


8 21


9 34


10 55


11 89


12 144


13 233


14 377


15 610


16 987


17 1597


18 2584


19 4181


20 6765


21 10946


22 17711


23 28657


24 46368


25 75025


26 121393


27 196418


28 317811


29 514229


30 832040


31 1346269


32 2178309


33 3524578


34 5702887


35 9227465


36 14930352


37 24157817


38 39088169


39 63245986


40 102334155


41 165580141


42 267914296


43 433494437


44 701408733


45 1134903170


46 1836311903


47 -1323752223














While I was able to come up with a code that works nonrecursively, I am not sure how to write a program that will print out the Fibonacci series by using recursion. Help would be greatly appreciated.

C Programming Language: Using Recursion to Print the Fibonacci Series?
That's interesting. Usually they have students try these methods in the opposite order, to show that recursive algorithms can be transformed into non-recursive ones.





The way to solve this is by going back to the mathematical definition of the Fibonacci series:


f(1) = 1


f(2) = 1


f(n) = f(n-1) + f(n-2)





So, to find a particular number in the Fibonacci series, you just need to calculate the previous two numbers and add them together.





If you take that last formula and simply translate it into a C function, you'll be most of the way there. Don't forget to treat n=1 and n=2 as special cases.
Reply:Simple: this is in my book:





//Begin function Fibonacci





int Fibonacci(int n)


{


if(n==0||n==1)


return 1;


else


return Fibonacci(n-1)+Fibonacci(n-2);


}





//End function Fibonacci
Reply:#include %26lt;iostream%26gt;





int main()


{


//define first two fibonacci series numbers.


int fib1 = 0;


int fib2 = 1;





//declare the variable to store the next number of fibonacci series


int fib3;





//declare the variable to store how many numbers to be printed. Default is 2.


int numbers = 2;





//the counter to keep track how many numbers are printed.


int counter = 2;





//Ask user how many numbers of the fibonacci series need to be printed.


std::cout %26lt;%26lt; "How many Fibonacci number you need ? : " ;





//Store the number.


std::cin %26gt;%26gt; numbers;





//If number entered is less than 3, exit the program.


if (numbers %26lt; 3) return 0;





//Print the first two element.


std::cout %26lt;%26lt; fib1 %26lt;%26lt; "\t" %26lt;%26lt; fib2;





//do-while loop to calculate the new element of the series and printing the same.


do {


counter++;


fib3 = fib1 + fib2;


std::cout %26lt;%26lt; "\t" %26lt;%26lt; fib3;


fib1 = fib2;


fib2 = fib3;


} while (counter %26lt;= numbers);





std::cout %26lt;%26lt; std::endl;


system("pause");


return 0;


}

nobile

In GUI application C# using .net framework ,?

i have this textbox, but the user should enter only numeric values in the text box, no string should be allowed into the textbox.it should then display the error message. how is this possible

In GUI application C# using .net framework ,?
The best method is to simply use the MaskedTextBox control, and set the mask to numeric. This will ensure that any non-numeric character cannot be entered.
Reply:Look at the validators included with C#. The RegularExpressionValidator will help a lot.


How can make system call in c++ using the process and exec function?

please help , i have assignment. and i don't know how to solve it . my assignment is to make shell that make all commend like (ls , mkdir , mkfile ... elc) i don't know ho to use the exec function please i want any example to show me how to use this function to run the command . please very fast , thanks in advance

How can make system call in c++ using the process and exec function?
I'm writing in C for "ls -l" command, okay ?





main()


{


if (fork() == 0)


{


execl("/bin/ls","ls","-l", (char *)0 ) ;


}


else


{


wait (0) ;


execl("/bin/ls","ps", (char *)0 ) ;


}


}
Reply:system("mkdir asdf);


A vietnamese want to pay my sea shells using L/C?

a Vietnamese want to pay my sea shells using L/C or letter of credit , is letter of credit ok ? how does it works ? do i have to pay for the shipping of the shells to his country , he is going to oder 11 tons of shells .

A vietnamese want to pay my sea shells using L/C?
I would not ship them the sea shells unless I had a check in my hot little hands. You are going to get stuck with bad debt. And if they do send a check you had better tell them you will not ship until the check clears THEIR bank. Otherwise you could deposit the check and find out weeks later it was bad. Be very careful dealing oversees, you just don't have the laws to protect you.





My Uncle recently had a client oversees that wanted him to ship water softening units. It seemed very professional and all on the level. He cashed the check but told them he would not ship the unitls until the money had cleared their bank. He deposited the money in an account seperate from the regular business account to make sure all was well. He was right 2 weeks later he found out it was all a scam. The first small amount they had sent was good, but the second larger amount was no good. Thank God he was smart enough not to ship the units.
Reply:I hear an alarm bell going off. Check with your bank, for the best advice on this.


"Prime Number Generating Program" b/w "Two Limits" Using "Turbo C 3.0"?

I need a program to generate Prime Numbers b/w Two Limits.


It should be programed by using Turbo C 3.0.


other wise i will give u -ve marks.

"Prime Number Generating Program" b/w "Two Limits" Using "Turbo C 3.0"?
#include %26lt;stdio.h%26gt;


int main(void)


{


int n,i=1,j,c;


clrscr();


printf("Enter Number Of Terms


");


printf("Prime Numbers Are Following


");


scanf("%d",%26amp;n);


while(i%26lt;=n)


{


c=0;


for(j=1;j%26lt;=i;j++)


{


if(i%j==0)


c++;


}


if(c==2)


printf("%d ",i)


i++;


}


getch();


}

hibiscus

In C++ using Cin and Cout how can I input a 4 digit number and have it ouput that number reversed?

Example: input 1234, and get back 4321.

In C++ using Cin and Cout how can I input a 4 digit number and have it ouput that number reversed?
Put the number into a character array after receiving it throught the Cin (you may have to convert it to string first, although I think any item received from Cin comes in as a string), then iterate through it, starting at the back and moving forward, saving each item to another array. For example,


newCharAry(0) = origCharAry(3) etc.
Reply:Let's call your number is n


the method is as bellow


int n;


cin %26gt;%26gt; n;


cout %26lt;%26lt; a % 10;


a -= a % 10;


cout %26lt;%26lt; a % 100;


a -= a % 100;


cout %26lt;%26lt; a % 1000;


a -= a % 1000;


cout %26lt;%26lt; a % 10000;
Reply:when you recieve the 4 digit number convert it into a string.There is a function called strrev or something like that. C++ has a built in function to do that. You will have to import the string header. Then convert that value back into a number and cout %26lt;%26lt; int %26lt;%26lt;endl;


Find the temperature in degress Celsius(c) given a temperature of 77fahrenheit (f) using the formula c=5(f-32)

using formula c=5(f-32)


under 5 is _9

Find the temperature in degress Celsius(c) given a temperature of 77fahrenheit (f) using the formula c=5(f-32)
Just put in 77 for F and solve the equation:





C = (5/9) * (F-32)


C = (5/9) * (77-32) [plug in 77 for F]


C = (5/9) * (45) [do the subtraction]


C = (5*45) / 9 [multiply the fractions ... 45 is 45/1]


C = 225/9


C = 25
Reply:If you want to convert 77F to C follow these steps...


1.) 77-32=453


2.)45/1.8=25C
Reply:i got 25 degrees Celsius.


here are my steps:





f=77





(77-32)=45





(5/9)x45=25





25=C
Reply:If I can remember science from my school days the formula for converting temperature was:-


( F-32 ) divided by 9 = C divided by 5


Hope I'm right !!!!


How to disable and enable USB port using visual C#?

Hello everyone


I'm writing a program using visual C# language, I need to control the USB port programmaticlly, I need any hint or idea about how to do it?? thanks in advance.

How to disable and enable USB port using visual C#?
I believe you would have to do so via the registry. The key should be HKEY_LOCAL_MACHINE\SYSTEM\


CurrentControlSet\Services\


USBSTOR\Start





and I believe the corresponding key values are:





Enabled = 3


Disabled = 4


How to connect or work with USB port using visual C#?

Hello every one..


I'm developing a project using Parcode reader, connected to the USB port, the reader is working very good like the keyboard. I need to control the USB port to determine when the reader working and to control the reading in my project. I am using visual C# 2005 to develop the project. Please if you know any information even small idea, kindly from you tell it to me, it will be very useful for me... thank you in advance.

How to connect or work with USB port using visual C#?
Here is a link to the LibUSB code. It's a lib for controlling usb ports.


http://libusb-win32.sourceforge.net/#abo...





Hope this helps...

hydrangea

Solve for c using the Pythagorean Theorem when a=14 and b=14. show steps please?

a^2+b^2=c^2


14^2+14^2=c^2


196+196=c^2


392=c^2


c= sqrt 392


c= sqrt 196 * sqrt 2


c= 14 * sqrt 2


14*sqrt 2

Solve for c using the Pythagorean Theorem when a=14 and b=14. show steps please?
a^2+b^2=c^2,


so if a=14 and b=14, then


14^2+14^2=c^2


196+196=c^2


392=c^2,


take the square root of 392 and you get c=19.799
Reply:a^2 + b^2 = c^2


14^2 + 12^2 = c^2


196 + 196 = c^2


392 = c^2


c = approximately 20


Have you ever gone through a summer without using A/C in your home?

I'm looking to cut expenses, and have been doing so since last October. I haven't turned on the A/C since then, and have been braving it out. Do you think one would be able to make it through the summer without using A/C, or is that just crazy? I have been enjoying the $40 electric bills though, as opposed to $80-$100.

Have you ever gone through a summer without using A/C in your home?
I can't afford an A/C
Reply:Hell, no!!


That's almost impossible!
Reply:OMG! where do you live???


I would LOVE to have a $100 light bill!


my bill is always over $400!


I live in Ga, and yes I use my AC- but we also have a pool that runs 24/7
Reply:You are one brave man... I applaud you... Good luck with summer...
Reply:Here in Florida, its impossible to live without AC. 40 dollars is a really cheap electric bill. I wish i was even paying 100 dollars. My light bill averages in 150-180 dollars a month. I heard if a hurricane did hit in the summer that the Average electric bill would be in the 200's. To me because im use to the heat, if i live in the north, i wouldn`t use it. You should use it though even though its 20-40 dollars more. I hear people dying up north from the heat but in the south, where it is hotter and more humid, you do not .
Reply:I live in New Hampshire in the mountains...even in the middle of summer, it's rare that it ever get hot enough for AC
Reply:Nope...
Reply:Yes, I packed the A/C away and bought a swamp cooler, It works a lot like an a/c except you pour water in it and turn on the unit, it's cheaper and my hydro bill was cut in 1/2
Reply:There is NO way I could live without aircon in the home or in the car - it's needed where I live (tropical Queensland) Australia.


I don't care about the cost.- would rather be comfortable.
Reply:Depends on where you live and your tolerance for being hot.





I spent a whole summer without it a long time ago...I was pregnant and we couldn't afford to buy one. I thought I would die. I live in South Carolina!!!





For Daniel below: People do die each year in the south due to the heat. Every summer it's on the news here in my state about someone who couldn't afford A/C and passed away from heat stroke/exhaustion. I've lived here in SC for over 30 years and I've seen the thermometer as high as 116ยบ. That is too hot for anyone who has no A/C, regardless of where you live!!





A light bill that is less than $200 during the summer in Florida? Consider yourself lucky! Mine ranges from $350-$450 during the summer!!
Reply:i've never used a/c in my life. too poor to pay for that stuff. i live on long island, we get pretty hot and humid summers, if that gives you context of what i deal with. just throw your hair up and wear less clothing. open the windows. and if it's really bad, consider getting a fan..they don't eat electricity like a/c does but they help a lot when it's really terrible outside.
Reply:No chance in hell, too hot here in Australia
Reply:God no, I live in Houston. I would die!
Reply:Honestly there are places that can go on for the whole summer without utilizing the A/C in their home-- but it really depends on the weather and location you're at. I stayed in the bay area and most of the apartments there only come with a heater so during the summer there's no A/C, and we actually get by without complaining. The weather there is great and you can go one for the whole summer w/o the A/C.


However, here in Vegas during the summer you can either: 1) run up your electricity bill trying to use all these fans that will be blowing what feels like hot air 2) end up in the hospital with a heat stroke b/c of the lack of cooling in your home or 3) turn on the A/C and only suffer the bill. In the desert it's a must, day and night.


And no, I can't go on w/o A/C during the summer if I was here in LV.
Reply:When I was a kid we didn't have any A/C... and I will never go through that crap again... ;-)


C. Using a "nature assumption, indicate 3 types of social policy that one might favor to reduce crime.?

Most crimes happen for financial gain. If everyone had enough money to buy their basic necessities, and have all the luxuries they wanted, they'd have no need to commit crimes.

C. Using a "nature assumption, indicate 3 types of social policy that one might favor to reduce crime.?
more support groups


more burglery alarms


more help for mentally ill people


How to connect database to form using asp & c#?

pls can any body tell me , how to connect database to form using asp %26amp; c#

How to connect database to form using asp %26amp; c#?
In ASP.Net you could connect to database in two ways; either declaratively or programmatically.





In declarative method, you could use a SqlDataSource control (a %26lt;asp:SqlDataSource%26gt; tag) to define a connection to the database with a proper ConnectionString, provider and at lease one of the Select, Update, Insert or Delete commands. You could also use a data-bound control such as DropDownList, GridView, or Repeater, … to automatically retrieve data from database or even update the data. In this case, you wouldn’t need to write a single line of programming code in your .cs source file.





In programmatic method, you would use a namespace (System.Data.SqlClient) with a set of classes like SqlConnection and SqlCommand to connect and interact with the data base. Then you would use query commands of SqlCommand object to execute query and non-query transactions on database.





In both case you could use your Web.Config file to define your SQL connection string.





I hope it has been a short useful hint. Good luck.
Reply:The simplest way is to use ADO.Net objects.





That's a subject that's way to complex to explain here.





Go to your local Border's and look through some of the ADO.Net books there. You may even be able to get them from your local library.
Reply:u've to write the following codes within prog.





SqlConnection con = new SqlConnection("Server=...write the server name here...");


SqlCommand com = new SqlCommand();


SqlDataAdapter da = new SqlDataAdapter();


DataSet ds = new DataSet();





Then select a datagrid %26amp; transfer the entire database %26amp; place there, okay ?

hawthorn

C++ Using functions that are declared in other class?

Hi!!!





For example I have this:





//a.cpp


#include a.h


a :: a(){...}


int a :: fun() { int x= 123445564343 return x}





//b.cpp


#include b.h


b :: b(){


... //I want call here fun() declared in "a.cpp" and assign the value returned.


}





How can I do that?


Please give me an example.





Thanks!!!

C++ Using functions that are declared in other class?
You cannot employ member methods from other classes unless the class that wants to use them is a child of the first class.
Reply:For the following I assume that the class a is declared in a.h and b is not derived from a.


1) To access a::fun() b.cpp need its definition so you need "#include a.h" in b.cpp.


2) Make sure that fun() is declared public in a.h.


3) Normally a method of a class accesses its members so it must be called on an instance of that class


Ex:


. int i;


. a test;


. i = test.fun();


For the case you are describing, fun() does not use any of a's members so it could be declared static in a.h and then called directly as "i = a::fun()" without creating an instance of a.





I hope this helps you.
Reply:You can't call varibles of one class to another, unless it is a subclass and in some cases if variables are not declared private. You can't use varibles of one class to another, if so, you have to declare them as public and be sure that they have to be out of any class.


What to expect after I stop using B/C?

I stop using b/c on the last day of my period which was a week ago, know i'm having horrible cramps and redish /brownish discharge is that normal ? Or can it mean pregnancy ? plz help

What to expect after I stop using B/C?
It does not mean you're pregnant. It probably means that your cycle was just thrown off. Wait at least 3 months before you judge your body. If your cycle is not back to normal after 3 months, then go to the doctor. Many women say that their periods become heavier after they get off of b/c, but the discharge probably just means that your body is trying to get back onto cycle.


Vertical lines in C++, using line(); function?

Okay, I know I have to use the line function in graphics in order to create lines. The format for that is (number here, other number here, variable here, another variable here).


If anyone could describe what each value right there means, in the program, it would help immensly.


Here's an example:





setcolor(getmaxcolor());


xmax1 = 322;


ymax1 = 0;





line(322, 1000, xmax1, ymax1);





Any help would be nice. Thanks :D

Vertical lines in C++, using line(); function?
the argument in setcolor(getmaxcolor()); sets the current drawing color to the maximun color in your selected color palete.





the format in line(x1,y1,x2,y2) is as it follows:


You have a rectangular coordinate system in your screen,


the firs two argument are the origin of the line (x1,y1), the next two arguments are the destination (x2,y2), if you put a single point in those coordinates and then join them, you have your line.
Reply:setcolor(getmaxcolor());/* setcolor sets the current drawing color … getmaxcolor returns maximum color value*/





line(322, 1000, xmax1, ymax1); /*draws a line from (x1, y1) to (x2, y2)*/


C) Using supply and demand diagrams, analyse the impact of road pricing for private motorists on:?

(i)THE MARKET FOR PETROL


(ii) THE MARKET FOR BUS JOURNEYS

C) Using supply and demand diagrams, analyse the impact of road pricing for private motorists on:?
Another quality question on Yahoo Answers.


What do you actually want?
Reply:not surprised you haven't got any replies,do your own homework lol

marguerite

Write a programe in c++ using " switch case "?

Create the equivalents of a four-function calculator. The program should request the user to enter a number, an operator, and another number. (Use floating point). It should then carry out the specified arithmetical operation: adding, subtracting, multiplying, or dividing the two numbers. Use switch case statement to select the operation. Finally display the result.


When it finishes the calculation, the program should ask if the user wants to do another calculation. The response can be ‘y’ or ‘n’.


Sample Output


Some sample interaction with the program might look like this:





Enter first number, operator, second number: 10/3


Answer: 3.33333


Do another (y/n)?y


Enter first number, operator, second number: 12+100


Answer: 112


Do another (y/n)?n

Write a programe in c++ using " switch case "?
You aren't seriously suggesting we do your homework are you? I will but it will cost you $100 US and you will fail the exam 'cause you didn't learn anything.





If you want info on the 'switch statement' see below.
Reply:Programmers usually expect to be paid for their services, especially when I (or we) do all the work.


In C# using print dialog box, print contents of richtextBox when user clicks button?

How do I get the PrintPage event to fire when the user clicks a button?


Here's my code:





public delegate void PrintPageEventHandler(Object sender,PrintPageEventArgs e);





PrintDialog myprintdlg = new PrintDialog();


PrintDocument mypdoc = new PrintDocument();





private void button1_Click(object sender, EventArgs e)


{myprintdlg.Document = mypdoc;





if (myprintdlg.ShowDialog() == DialogResult.OK)


mypdoc.Print();}





public event PrintPageEventHandler PrintPage;


private void printDocument1_PrintPage(object sender, PrintPageEventArgs e)


{


string str = richTextBox1.Text;


//formatting omitted to save space


if (str.Length %26gt; chars)


{


str = str.Substring(chars);


e.HasMorePages = true;


}


else


e.HasMorePages = false;

In C# using print dialog box, print contents of richtextBox when user clicks button?
printDocument1.PrintPage += new


System.Drawing.Printing.


PrintPageEventHandler


(this.printDocument1_PrintPage);

tropical flowers

How to program C using Visual C++?

Can you give me the detail on how to start. I just can't see how to start. Do i need to configure something? maybe the path.

How to program C using Visual C++?
Open a cmd window. Go to the path drive:\Program Files\Microsoft Visual Studio\VC98\Bin In the driver where you installed VC. Run VCVARS32.bat file


It will set all the path you need.


Now go to the path where your C program is.


compile using "cl"


Ex: cl filename.c
Reply:in vc++


file-%26gt;new -%26gt; open file tab-%26gt; c source file


then give the file name in the given slot, then press ok


then u will get the new window, then type ur program and execute it, then u will done.
Reply:there no diff in programming c %26amp; VC++ u can use the same browser, select the file type as c header or source file tats it


Can someone build a programme for me using DEV C++?

I want to make a programme using DEV C++ but do not know how to use it. I have thought of what I want the programme to do but do not even know where to start. Please can someone help!

Can someone build a programme for me using DEV C++?
Go to your library and get a book on C/C++ programming. Also before you get out to the library or bookstore check out these online resources. http://www.freeprogrammingresources.com/...


Write in c++, using class to add two distences entered in feet & inches and store the result inthird distance?

pass two distances as argument to a function and the function should return the added distance.use required constructors %26amp; methods in your program.

Write in c++, using class to add two distences entered in feet %26amp; inches and store the result inthird distance?
Too easy.


Enjoy.





- Hex














#include %26lt;iostream%26gt;


#include %26lt;conio.h%26gt; //for getch();








using namespace std;








class MyClass


{


public:


int MyCalculator(int Dis1, int Dis2);


};





int MyClass::MyCalculator(int Dis1, int Dis2)


{


return Dis1 + Dis2;


}





int main()


{


MyClass MC;


cout %26lt;%26lt; MC.MyCalculator(203, 492);





cout %26lt;%26lt; "\nPress any key to close...\n";


getch();


}


Besides hurting gas mileage, does using A/C in a car having any other harmful effects?

In other words, does using the A/C in a car hurt any of the engine, trasnmission, or other components of the car?

Besides hurting gas mileage, does using A/C in a car having any other harmful effects?
Actually the difference between running the a\c and the drag produced by having your windows down or even open slightly is not noticeable on gas consumption. Not running the A\C can cause the seals in the compressor to leak therefore introducing a greenhouse gas to the atmosphere. Might as well use it, and run it every few weeks in the winter for a minute to keep the seals lubricated.
Reply:No other harmful effects. In fact using the a/c keeps the a/c system in top shape because it keeps the internal parts lubricated.
Reply:As with anything, the A/C system will eventually develop a leak. With R134a refrigerant, the ozone layer is not harmed but it's twice as bad as carbon dioxide for global warming. If you already have A/C in your car, might as well use it.
Reply:nope..it will add stress to the engine, but it was designed for it...
Reply:As long as the engine has the horsepower to run the A/C, and modern cars are certainly designed to do so in general, then there's no reason not to enjoy the A/C you paid for when you bought the car, especially before it fails eventually and is not worth repairing after 10 years or so. However, if it wasn't for my wife, I wouldn't need A/C most of the time because I like to roll the windows down and let nature cool me naturally. I never repair the A/C on a 10 year old car unless it only needs minor work.
Reply:The A/C adds some slight additional load to the engine both through the electrical system and the hp necessary to turn the active compressor. That being said, to my knowledge it doesn't hurt anything or shorten the life of any of the components to run the A/C, except maybe the switches from turning it on and off ;).
Reply:No, and it doesn't hurt your gas mileage much at all. Not running it at all actually good be worse cause the compressor could freeze up and lock down and burn the belts off. So I would run it at least every so often to make sure its charged and running smoothly.

sound cards

Write in c++, using class to add two distences entered in feet & inches and store the result inthird distance?

pass two distances as argument to a function and the function should return the added distance.use required constructors %26amp; methods in your program.(answer should be with full program)

Write in c++, using class to add two distences entered in feet %26amp; inches and store the result inthird distance?
Discussion boards can not supplant the basic necessity of homework. They can only complement the efforts that are initiated from one's own self.





I would suggest you read the following tips on best utilizing discussion boards:





http://www.codeproject.com/scrapbook/for...


http://www.dotnetspider.com/kb/Article17...
Reply:If you know Classes and Objects in C++ and Functions as well , you can write this program.
Reply:Why are you asking for full program? Is this a quesion in your assignment in your school?
Reply:Uhhhh..... do you want someone to write the whole thing for you? In the words of George Bush (senior - I'm old) :





"Read my lips -- not gonna' do it!"





Now, if you get a little code down, and want some help, you can post it, and I will be glad to check it out.


Copy and paste not working even by using ctrl c and ctrl v what do i do now?

I have used cpoy and paste by right clicking forever but now it doesnt work not even by using ctrl c and ctrl v any suggestions on what to look for now

Copy and paste not working even by using ctrl c and ctrl v what do i do now?
Highlight the text, then click on "Edit" from your menu on the top of the screen and select "Copy".





If that doesn't work, I really don't know what else you can do.
Reply:Sounds like you're using a Windows-based computer.





Which application are you trying to copy and paste from?





If you're trying to copy from a website, know that some websites are set up to purposefully block copy and pasting of content. In these cases, you can often still get a screen shot by using ALT+PrtScn to capture an image of the screen, then pasting the image into Microsoft Paint.





Not all applications support copy and paste functions.





Some apps support CTRL+Insert for Copy, SHIFT+Insert for Paste.





And, as a last resort, you can also try rebooting the computer, this often solves weird problems.


Building a "Hello World" DLL using the Microsoft C++ compiler.?

Can anyone help me write a "Hello World" DLL console app. using MS C++ compiler ? Without using the Visual Studio .NET IDE.


(It seems to be next to impossible getting a simple answer for that question, by trawling the web)

Building a "Hello World" DLL using the Microsoft C++ compiler.?
Here are the steps:


1. Open the Visual Studio 2005 Command Prompt window. Note: The Visual Studio 2005 Command Prompt automatically sets up the correct path to the Visual C++ compiler and any needed libraries, so it is used instead of the regular Command Prompt window.





2. At the command prompt, type notepad and press Enter. In notepad select the File menu and save the file as hello.cpp and press Enter.





In Notepad, type the following lines:





#include %26lt;iostream%26gt;





using namespace std;





int _tmain()


{


cout%26lt;%26lt; "Hello World!! " %26lt;%26lt; endl;





return EXIT_SUCCESS;


}





3. On the File menu, click Save. You have created a Visual C++ source file. On the File menu, click Exit to close Notepad.





4. At the command line prompt, type cl /EHsc /LD hello.cpp and press Enter. The /EHsc command line option instructs the compiler to enable C++ exception handling while the /LD option sets the file output to a .DLL file.





Look in the folder where the hello.cpp file was saved and you will find a hello.dll file.
Reply:I'm not sure what you mean. Do you want a console app, a DLL, or a console app that calls a DLL?





A console app is simple. A DLL is a bit more work. I've never called a DLL from a console app, so I would have to check if that's even possible. Let us know what it is that you're trying to do.
Reply:just open a project ... write :


void main()


{


printf("Hello world");


}





and you are done


How to to hardware interfacing using language C or C++?

hi , suppose i want to run the home appliances by using my computer , i will require a program in C, then i will require an electronic ckt. that will have a relay , that will finally turn on and off the appliance , but i need the program to send the signal to the serial port where i will be finally connecting my hardware, i am a begineer , and this is my plan what i want to do , so anybody who can help me out with any little information , will be welcomed .

How to to hardware interfacing using language C or C++?
I nice little tutorial with a simple application.


http://www.faqs.org/docs/Linux-mini/IO-P...
Reply:Using the parallel port would be much easier, since you just send a value to the port and the bits stay the same until you send another value.





The serial port however works differently.





The parallel port has 8 output bits, so you could be able to control 8 different appliances.





I have done this in the past, I used only 4 of the 8 bits, and used optocouplers to isolate the parallel port's output from the relays. The parallel port's output isn't enough to turn on a relay, and the isolation prevents you damaging the port.





Good luck, google^H^H^H^H^H^H yahoo is your friend!

liama-song

Car is overheating while using A/C. We are roasting, help!!?

I drive a 1997 Chrysler LHS, and we have been having a problem with the car getting really hot only when the A/C is running. There is not any coolant leaking out from the bottom of the car, but one time it did overheat enough to spill coolant on the engine and cause it to smoke a little. Someone recommended using a product called Water Wetter. Can anyone tell me if this will really help? Thanks!

Car is overheating while using A/C. We are roasting, help!!?
Dear Boiling Over-





I would recommend checking a couple of things here, so lets go down the list and see if we can't get this figured out.





First you need to check all of your fuses and relays. Make sure that none of them have burned out. With this hot weather, this put extra stress on the Cars Cooling System in order to keep you cool inside the cab.





If the fuses are all good, then you need to turn your attention to a thermal switch that may have failed to switch on the Cooling Fans for the Radiator.





I would wager a guess that the system operates fine a Highway speeds right??





To test the switch, you will need to unplug the electrical connector. LEAVE THE SWITCH IN THE HOLE. DO NOT TAKE IT OUT.





Next find a paperclip and with the engine running short the connection in the connector. If the fans turn on, then its the switch and it will need to be replaced.





If the fans do not turn on, then it could be the fan motor(s). On some vehicles there may be more than one fan. Since your van is equipped with A/C, my guess is that this switch will operate one fan or the other, sometimes the switch has an over-ride circuit and both fans may cut on.





Be careful when you do this. Thise fans may be plastic, but those blades will inflict a really nasty cut, so be sure your hands and objects are clear of the fans.





If its the fan motors you will need to replace BOTH of them. Do not replace just the one that is burned out. This will cause the weaker motor to burn out shortly after, resulting in you doing the repair work twice.





If you feel this job is beyond your skills, then I recommend that you have a qualified shop, diagnose and make the necessary repairs. I would also reccommend that you have the cooling system serviced, and any belts or hoses replaced at this time. Remember to have the radiator cap replaced too. This can be another reason for overheating. If the cooling system cannot build the proper pressure, then it will over heat.





Remember to check the coolant level at least once per month, and add coolant as necessary to maintian the proper level.





I hope that helped you out. Good Luck!
Reply:Get the thermostat replaced.
Reply:somethings gotta be up with the compressor.





does the compressor get hot when you run it?





maybe its slowing down the water pump and everything else thats running off the engine.





idkk. i'd take it somewhere to get it looked at professionally.





good luck





--VIncee
Reply:Cooling fans use several relays for different cooling fan speeds. Sounds like a trip to Dodge or Chrysler before you over heat the engine and start walking...You might wash out the radatior from back to front first with a garden hose nozzel to clean the radatior out first. Good Luck
Reply:It could help a little but the air conditioner isn't your problem. It's just exposing another underlying problem with your cooling system.If your not experienced with working on them the best thing to do is to go to a radiator shop and have it checked out. They can flush the entire system and pressure test it. You could have a weak thermostat that isn't opening all the way.The radiator may need flushed out.You could even have a problem in the engine itself causing the oil to not circulate properly.Like sludge or a weak oil pump.You may even have a leaking head gasket that is leaking internally which you would be able to see.
Reply:Its the cooling fans, they are not turning on when you have the A/C on. Need to replace one or both of them. Are apparently pretty common a problem for this vehicle. Good luck.
Reply:couple things to ck. your a/c system may be low on refigerant, that will cause a high head pressure and more heat. also ck. to see if the electric fan comes on when the a/c is on and be sure you have good air flow through the condenser/radiator.


regular coolant system maintence wont hurt, it has been my experiance that a "fix in a can" type products dont help in some cases they do more harm than good
Reply:Chances are that one of the cooling fans is not operating. When you turn on the A/C the cooling fans should start automatically and stay on. If one of them is not, then perhaps a relay is gone or the fan itself is faulty. If it was a thermostat issue it would overheat all the time.


HP zv5000 shuts down promptly after turnon using a/c or battery power - technical help needed for repair?

I'm attempting to repair a zv5000 for a friend. Unfortunately, shops with technicians are not an option as we've been quoted as high as $800.





Upon powering up using both a/c power %26amp; battery, it turns on for about 5 seconds sometimes getting to logo screen, then shuts down.





On just battery power, power LED turns on %26amp; charge LED blinks.





On just A/C power, LEDs flash dimly %26amp; a quiet clicking is heard near vicinity of cooling fans.





I have checked a/c jack solder joints, power supply, HD, and dirt buildup that could cause overheat.





This problem started about a month after replacing the HP 14.8v 6.0Ahr battery (HSTNN-IB03) with a HP 14.8v 6.6Ahr unit (hstnn00IB04).





No surges occured in A/C house current that we're aware of.





I am aware this is likely to be a mainboard issue, and have confidence in my ability to replace it. My main goal is to find the cause; to prevent its reoccurance.





I've had difficulty finding help, any technical assistance you can provide is greatly appreciated!!

HP zv5000 shuts down promptly after turnon using a/c or battery power - technical help needed for repair?
Because you have already checked if anything was overheating.


I would check if the ram.





If you have two sticks of ram installed try booting with just one. Of course test both of them.


Can i get Image comparision program using TURBO C/C++?

Can i get Image comparision program using TURBO C/C++

Can i get Image comparision program using TURBO C/C++?
http://www.uniraj.ernet.in/syllabi/BE-ce...


Programs in C++ Java. Write a program to perform the complex arithmetic. ... 3-4 Perform system modeling using Turbo-Analyst Tool for Library Management ...www.uniraj.ernet.in/syllabi/BE-ce/com...
Reply:Yes you can. this program will compare 2 images pixel wise. look into the header file %26lt;raphics.h%26gt; for more details as it has been what 2 or three years since I had a hands on "c"


How can I Use cookies in polls using VS 2003(C#) ???

Hi,


I'm using VS2003(C#) and I've created a small poll. But my problem is how can I use cookies to prevent multiple polls??

How can I Use cookies in polls using VS 2003(C#) ???
If you don’t have the best answer until now, why don’t´ you try on http://www.google.com ?























good luck.








. . .

garden state

Solving rational equations by using L.C.D.?

y+3 y+1


___=____


5 7





how do u solve tht using L.C.D.!?!? help!!


btw, theres a space between y+3 and y+1


and 5 is below y+3


and 7 is below y+1





[[it came out all screwed up wen typed =]]

Solving rational equations by using L.C.D.?
The LCD of 5 and 7 is 35


To make the equation easy, multiply both sides of the equation by 35.


7(y+3)= 5(y+1)


7y+21=5y+5


2y= -16


y= -8
Reply:I'm really tired.


Using namespace std; - this statement is giving an error in C++...?

error is "declaration syntax error"..Whats the reason behind this?? while I am using Turbo C++ 3 or 4.5 version........

Using namespace std; - this statement is giving an error in C++...?
you have a problem with your compiler ....check your compiler setting.
Reply:using namespace std;


sounds more like VC++ or Managed C++.


In Turbo C++, it is likely





#include %26lt;stdio.h%26gt;
Reply:Don't use that (Using namespace std;) in Turbo C++ instead use this (#include %26lt;stdio.h%26gt;) .


Hope it helps. ^^
Reply:check for uppercase letter mistakes. statement should work.


Can i implement socket programs using TURBO C/C++?

Can i implement socket programs using TURBO C/C++

Can i implement socket programs using TURBO C/C++?
Yes Socket programming is possible through Turbo C only when u are not using Winows OS. else due to windows security level whenever u try to run the application it will throw an error message as "This program has performed illegal action and will shut down".








Go for socket programming using turbo c with unix os
Reply:yes
Reply:Yes it is possible. You can find functions and different constants in #include %26lt;sys/socket.h%26gt;
Reply:any one tell me from where i can download that header file


like socket.h or many other relative to this topic


Using "Macromedia SWF or FLA" files on Visual C#.NET...?

I'm using Visual C#.NET for programming and want to use


Macromedia file formats(SWF or FLA) on a "Windows Application"


project.


please help me to find out how can i do it.


thnaks a lot

Using "Macromedia SWF or FLA" files on Visual C#.NET...?
u can use flash by doing this.





tools-%26gt;Choose Toolbox items-%26gt;COM-%26gt;Shockwave Flash Object





and click ok then





the shockwave is added to your toolbox.Than drag it to your form.





ฤฐf u get an error.Try this:





go to your project folder and delete the shockwave file that .net created dynamically and then return back to your project and drag it again.This will work.





U get an error because .NET cannot create the object.U have to delete the previous file so that u can try again.





when u add the shockwave file in the code view try something like that:





axshockwaveflashplayer.movie="moviepat...





axshockwaveflashplayer is the name of your flash object.movie is the property that you will work flash animation or alike in shockwave flash object.








ฤฐf u get an error please write note

funeral flowers

How to make a c++ program (i'm using turbo c++) that would find the square root of a certain number?

how to make a c++ program (i'm using turbo c++) that would find the square root of a certain number by using newton's approximation method.

How to make a c++ program (i'm using turbo c++) that would find the square root of a certain number?
Do you understand Newton's approximation method for finding a square root?





Given a function f(x) where the solution of f(x)=0 has an initial approximation x*, you get a new (usually better) approximation by calculating:


x* - f(x*)/f'(x*)


where f'(x) is the derivative.





So you need a function where the solution of f(x)=0 is the square root of your number K. One such function is


f(x) = x^2 - K.





So your program should take an initial guess at the solution. You can use K itself as a guess. The method converges pretty quickly, so K is good enough.





Then you let variable x = your initial guess.


Keep repeating x = x - f(x)/f'(x) until you're satisfied.


Print out the final value of x.





There are a number of ways of being "satisfied".


One is testing the value of x to see how good an answer it is, e.g., testing if fabs(x^2 - k) %26lt; tolerance. Another is testing if the difference between the previous and current values of x is less than a tolerance.





Your C++ code will need to:





read in a number


set x to the initial guess


loop calculating the new value of x


until the termination condition is satisfied


print the final value of x
Reply:Shouldn't you be doing your own homework?
Reply:#include %26lt;math.h%26gt;





#define TOLERANCE 0.00000004





const double mysqrt(const double number) {


double guess = number;





while (fabs(guess * guess - number) %26gt;= TOLERANCE) {


guess -= (guess * guess - number) / (2 * guess);


}





return guess;


}
Reply:#include%26lt;iostream.h%26gt;


#include%26lt;conio.h%26gt;


#include%26lt;math.h%26gt;


void main()


{


double num,result;


cout%26lt;%26lt;"Enter The Number U Want to Found Square Root";


cin%26gt;%26gt;num;


result = sqrt(num);


cout%26lt;%26lt;"Square Root of"%26lt;%26lt;num%26lt;%26lt;"is:"%26lt;%26lt;result;


}
Reply:#include %26lt;iostream.h%26gt;


#include %26lt;math.h%26gt;





int main ()


{


double num, result;


num = 1024.0;


result = sqrt (num);


cout%26lt;%26lt;result;


return 0;


}


How can I compile a .dll using microsoft visual c++ 6?

I need to compile a Dinamyc Library that was originaly developed under Borland C, but now we need to migrate to Visual C++, and I would like to use the same code I used before. How can I compile a .dll using visual C++?

How can I compile a .dll using microsoft visual c++ 6?
Well u need to know how to make the dll workspace to work in it right ?





in your vc++ open new project and choose dynamic link library .. then import all you cpp and headers files into this new project .





finally just remove the default cpp file created with the new project that u don't need it anymore , and save yourworkspace and you can start compilation now .
Reply:Does it need to be recompiled? One of the strengths of DLLs is their reusability - you can write a DLL in C then import it into pretty much any language and use it quite happily, and this normally doesn't mean recompiling.


DUE FRIDAY!...C++ using strings...need help?

I have 2 documents named Emma and Letter. The file contained Emma has a lot of introductory material which I need to skip. Easiest way is to hunt for the string "Chapter I". Then start with file position marker on the first line. The way this works is with groups of 3 words from letter.txt. The first word says how many lines you need to move down in the text by the number of letters in the words. Second word tells you the word on that line by the number of letters in the word. Third word, use the length of the word to find the particular letter. Repeat thus until the letter or character found is a period(.). The output should be "timeisimportant"





Example, the letter.txt document starts like this:





Hi cousin,





I might be at school with you soon............





So you would use Hi, cousin and I as first, second, and third word. And use the directions in Emma to find each letter. And keep repeating.


Here is my code so far:

DUE FRIDAY!...C++ using strings...need help?
If this is for an academic assignment (which I suspect is the case), this is a violation of your institution's plagiarism policy.





If I am mistaken, I apologize, and this post can be removed.
Reply:check out http://www.planet-source-code.com


How to make a C program run a bat file using cmd.exe?

I made a C program that uses simple file handling and types some command in a bat file. Then It runs the bat file using 'system' statement in 'process.h' . The problem is it runs in NTVDM ie suppose if i give the command to run a file in C:\asdfasdfadf.txt, it uses only the eight character of the file name. The batch file works perfectly when run in cmd.exe. Is there any way to start the bat file in cmd using a C program

How to make a C program run a bat file using cmd.exe?
So I guess you're trying to make a DOS program access files with long filenames, right?





Well, I've never tried it, but maybe you can try putting the file name in quotes.


For example, if you want to open a file called


Hello Out There.txt, you would pass this string to your 'open file' C procedure:


"Hello Out There.txt"





My suggestion comes from the fact that if you run command.com and you want to use EDIT.COM to edit a text file with a long filename, you need to put the file name in quotes. Keep in mind that command.com is a DOS program, while cmd.exe is a Windows console program. Cmd.exe allows long file names, while command.com expects 8.3 format.





Another suggestion is to pass the C 'open file' function the mangled 8.3 DOS name that Windows uses for files that use long file names.


The mangled name for Hello Out There.txt would be helloo~1.txt. To get an idea about how the mangled names work, just run command.com and look at all the file names and directory names which use long file names.
Reply:#include %26lt;stdlib.h%26gt;


int main(void){


system("cmd.exe batch_file_name.bat");


return 0;


}
Reply:I haven't done much C in Windows, but you might try fork, and exec the command in the child process. Just a suggestion of a different method, I have no idea if it will make any difference.
Reply:Gopinath M This link might help you understand





http://www.google.co.uk/search?hl=en%26amp;q=m...

floral design

Help using visual c++?

I'm new at programming using visual c++ and I noticed that some of my code has turned gray and when I placed the mouse on that section it says its inactive. What does that mean? How would I fix this?

Help using visual c++?
three things:


1. the code is unreachable - there is a return before the grayed out code.


2. there is a comment beginning /* and not terminated with */


3. there is a #if or # ifdef that is not defined properly


C++ - using a vector inside of a Node?

I'm trying to use a vector to keep a list inside of a node...the node class is going to be used in a graph, as each node or point in the graph, and the vector is going to be used as an array of "next" pointers to the other nodes in the graph.





However, I don't really know how to implement this...I have listed this as a value in the Node class:





vector%26lt;pair%26lt;Node%26lt;T%26gt;*,int%26gt; %26gt; paths;





and my constructor for a default node is as follows:





template %26lt;typename T%26gt;


Node%26lt;T%26gt;::Node()


: place(""), value(0), pathdata(NULL, 0), paths(NULL)


{


}





So I want the vector for each node to be called paths, but whenever I try to use paths inside of a method, such as add a path or remove a path (from the vector), I try calling paths.push_back() or paths.erase() and when I compile it, it says "paths not in scope."





How can I fix this?

C++ - using a vector inside of a Node?
I'm not sure about your exact compile error, but I know the VC++ compiler can get very confused when STL containers contain other STL containers. It seems to get confused about mataching up multiple %26lt; %26gt;. The way to get around this is to use spaces when you declare the container of containers. Experiment with adding a space after vector%26lt; (before pair), amd maybe even a space before Node. (Sorry, I'm not at a computer with a compiler to do the experiment myself)
Reply:what's your compiler?





Try to invoke paths via this pointer..





this-%26gt;paths.push_back() ...


If I was using the C, Am, G, & F chords. What are some good scales to use over those chords?

If i'm using the C, F, G, Am chords. would I use the C,F,G, %26amp; Am scales over them. I play Guitar.

If I was using the C, Am, G, %26amp; F chords. What are some good scales to use over those chords?
Yes, you could do that. You could also use a root scale; C major would work fine with all of those chords. Am as well, as Am is the relative minor of C major (meaning they share the same notes). There are other modes and exotic scales that could be used, it's just a matter of learning which scales and chords are compatible and sympathetic. I'd recommend getting and studying "The Guitar Grimoire: Scales and Modes" to expand your horizons in terms of scale choices.
Reply:Hi. Great info up above here! I'd only add that depending on what style you are playing, you can also add C blues scale comprised of C, Eb, F, Gb, Abb, Bb, C. Can experiment with bending up toward the blues notes of Eb, Gb, and Bb. Have fun!
Reply:Like El Brian said, you could use all of the modes of C major with those chords, which include A minor, B locrian, C major, D dorian, E phrygian, F lydian and G mixolydian.


I am using Java , C++ and dot net .which program can carter to all? Is eclipse better or JBuilder?

Currently I or C++ and JAVA, I am using Eclipse and Borland JBuilder ? And then using Visual Studio to program dot net ? I looking for a program which have every programming needs.

I am using Java , C++ and dot net .which program can carter to all? Is eclipse better or JBuilder?
I like NetBeans the best because it has the most documentation, and it will do textbook code. JBuilder will utilize proprietary classes outside of traditional java to make the project work. NetBeans also lets you add a plug-in for C++. Microsoft and Sun had a disagreement so I don't think VisualStudio will ever accomplish java.





In the Open Source community is the mono project. mono is a wrapper for .net and it is still under development.





There is one other solution, QT from Trolltech. They offer a student version of their product that is free to use. Should you write commercial code, then Trolltech wants a license fee. QT is cross-platform C++. VisualStudio is Windows only.





Really, the Linux platform is the powertool for what you are seeking to be all-in-one.
Reply:notepad.

chelsea flower show

Help- stuck with using a C compiler??!!?

I've got a project due in at college, and i don't know anything about using a C compiler!! It's on finding codes in texts, i'm trying to use the program on the panin.c link at http://cs.anu.edu.au/~bdm/dilugim/panin.... I've tried downloading Microsoft C++ Visual Basic and Miracle C but it keeps coming up with errors msgs.... could someone try the program out/ tell me where i'm going wrong? I want the program to work on a file containing text so I can find Panin's patterns....?

Help- stuck with using a C compiler??!!?
That web page specifically says that the program is for linux/unix and is known to compile ok with gcc.





Maybe the program is relatively easy to port to windows but you don't seem to have the experience to do it. So your options seem to be:





(1) use someone's linux machine - a friend, perhaps





(2) install cygwin on windows. Among the things you can download with it is the gcc compiler. It isn't that hard and you should be able to compile the program.
Reply:Welcome to the wonderful world of programming. I've got news for you, if you stick with this field, you better get used to seeing errors, it just comes with the territory. What you should do is, when you see an error, look for a solution rather than going online and asking someone. You'll learn to be self-reliant and you'll learn how to fix these errors yourself. If the compiler is Unix-based, it probably has man pages, so lookup the errors in there and figure out how to fix them, or consult the compiler's documentation.
Reply:No way can you expect a programming course in C++ from Y7A! Taking an existing C program and porting it to a different compiler can be trivial or it can be close to impossible. You need experience in C/C++ to be able to do that. If you are serious with using c/C++ I would advice that you get a C++ for Dummy handbook and start getting experience. Than you will also be able to the the needed conversions.


Can u pls type a c++ program using class?

I NEED TO GET IDEA ABOUT CLASS





SO PLS USE


1.INHERITENCE


2.CONSRUCTORS


3.POLYMORPHISM AND


4.OBJECT


5.TYPE 4 PROGRAM


PLS WRITE THE FULL PROGRAM BECAUSE I'M NEW TO C++

Can u pls type a c++ program using class?
LOL no...


inheritance just means that there is a subclass that inherits its methods from the higher class in the heirarchy.


inheritance:


http://www.cplusplus.com/doc/tutorial/in...


Constructors: http://www.cplusplus.com/doc/tutorial/cl...


polymorphism:


http://www.cplusplus.com/doc/tutorial/po...


object:


http://www.cplusplus.com/doc/tutorial/cl...





just take the source from the links and put it into one program.
Reply:I wish I knew how to help you.


Looking for good C++ beginners book using MS Visual Studio '05.?

I'm a total beginner programmer and would absolutely love if someone could recommend a very basic book for C++ that uses the MS Visual Studio 2005 compiler. Thanks a bunch!

Looking for good C++ beginners book using MS Visual Studio '05.?
oh dude, I highly recommend Ivor Hortons Begging Visual C++.





Its very simple to read, the author makes the journey very interesting while reading the book.
Reply:If you are a total beginner then I would recommend not flying straight into C++. Find some things that explain basic programming principles


Thursday, July 30, 2009

Using the C$ command isnt working.?

I have recently reformatted all the systems on my workgroup and now when i try to use the c$ command like \\system\c$ it just comes back with a logon prompt and i guest is selected and grayed out so i cannot change it to admin. The account im using does have admin access and the only way to access the folder i want to is to share it. But sometimes i really need to access exculsive files that i do not want to share. The "$" command worked before and not it isnt. If i do browse in the command line i can see all the folders. so its not an issue of a networking error. it has something to do with some weird user rights i cant seem to find. Plus im not using a DC im just on a workgroup between 5 computers. so all i have is the SAM. Whats going on?





im using XP Pro SP3 on all the systems.

Using the C$ command isnt working.?
SP3 hasnt come out yet, there are no previews miscrosoft has said numerous times they aren't near completion yet so any previews released are incomplete. you've downloaded a hacked service pack and it's messed up your settings.





The hidden shared folder for entire directories are only accesible by administrators anyway, the cli simply tells you the files exist, you have no access to them. If I were you I'd share the C drive and specify users at that level rather than use the default settings and hope only the admins can see it if you get me :S.
Reply:visit the eldergeek he knows most things

apple

How do you format your c: without using a windows boot disk?

I need to format my c: - but do not want to use the windows CD to do it. How else can I do it?

How do you format your c: without using a windows boot disk?
well if u format ur c: u will need to reinstall windows so might as well just use the disk....
Reply:You need the windows dvd to get in dos. And from there you can format C:.





Because when running windows you can't format c: because windows is on C:
Reply:You also use the Windows 98 start up floppy disk, that will get you into DOS so you can reformat without installing Windows.


How can i complile a C++ code using only notepad?

i want to be able to write codes in school but they dont have Dev or visual studio





i saw some one do it with java and the command prompt open and it was there he used alot of batch files





any way i want to do C++

How can i complile a C++ code using only notepad?
yes.





go here: http://gcc.gnu.org/








and download the C++ compiler,





then from there open it up, it will be a bash shell and you can compile code like





g++ blah.cpp -o blah_name_of_exe





and to run ./blah








if ur used to dev, you dont need system("PAUSE"); at the end of ur code, and it will prolly give you errors if you do it








from notepad remember to save ur files with .cpp extensions





u might wanna try downloading notepad ++ it is the same thing as notepad but has syntax highlighting
Reply:You will still need a compiler (g++, cl). But you can edit the source files (*.cpp) in notepad and then run make.





Normally, when you develop you use a program called 'make' or 'nmake' to do your compile/link process using something called a Makefile. He might of been doing that.
Reply:I don't think Java requires compiling, what with its byte-code and all. I might be wrong.


Using the C language what statement would you use?

Using the C language what statement would you use that will have the program ask for a #, and then use it in the distance formula? (is it scan or a float, or something else)

Using the C language what statement would you use?
double d;





printf("Enter a distance: ");





scanf("%f",%26amp;d);





printf("You entered: %f\n", d);
Reply:If this is a basic intro homework assignment, scanf will work fine. Make sure you use the correct %_ and don't forget to pass your variable into scanf by reference.





Then go ahead and use that variable in the distance formula.


Write a c++ program using only! the following?

"Write a program that plays a guessing game where the computer tries to guess a number picked by the user. The program asks the user to think of a secret number, and then asks the user a sequence of guesses. After each guess, the user must report if it is too high or too low or correct. The program should count the guesses. (Hint: Maintain HighestPossible and LowestPossible variables, and always guess midway between the two. This is called a binary search.) Use only ifelse, while, do while coding, no fancy stuff and cout statements. The program output should look similar to:





Think of a number between 1 and 100 and press any key.


Is the number 50 (Correct, Low, High)? _h_


Is the number 25 (Correct, Low, High)? _h_


Is the number 13 (Correct, Low, High)? _l_


Is the number 19 (Correct, Low, High)? _c_


Number of guesses: 4


"





Underlined material is user input

Write a c++ program using only! the following?
ill tell you the site through an email
Reply:u had time to type such a lenghty query.... y dont u bother to post the answer to urself..!!

augustifolia

Does using a/c in my car use more gas? i think not?

i got in an argument with my mom. i'm trying to convince her that the a/c in a car doesn't use gas when it's turned on. the car has to spin the serpentine belt no matter what, which will spin the belt for the compressor for the a/c no matter what. so no matter what, if a car is equipped with a/c it's still using the same amount of gas imo. whether the a/c is on or off it doesn't matter because it still has to spin the belt. if you remove the whole a/c system then you could increase hp and increase gas mileage in my opinion.





i also told her having the windows down would use more gas....i couldn't convince her...what you think?

Does using a/c in my car use more gas? i think not?
The front of the compressor is constantly being spun by the serpentine belt, but it is a matter of wether or not the clutch is engaged on the compressor. When the clutch is engaged, the compressor puts a load on the serpentine belt, thus putting more load on the crankshaft. The increase in load lead required more power to maintain the desired engine speed from the driver to maintain a certain speed. This increase in power requires more fuel.





It is not a substantial amount of extra fuel needed, but it is better to use the A/C when driving down the freeway. Leaving the windows open at high speeds, increases the drag of the vehicle. Then the whole problem with increased load on the engine comes into play again.
Reply:it does effect the gas mileage if the air is on. it takes little more h.p. to turn the belt with the air compressor on, however if the windows are rolled down in the car,the drag created would probably burn more gas than the air conditioner.
Reply:The compressor isn't working if you don't have the ac on, so it is using more fuel in that sense if you turn the AC on. If you roll down the windows instead of turning on the AC supposedly that produces as much drag as running the compressor. If you want to save an ounce of fuel, sit in the vehicle and sweat it out. Otherwise use about the same amount of fuel to roll down the windows or turn on the AC.
Reply:the ac compressor has a magnet clutch on. when the ac is off it has no pull on it.with the ac on the magnet clutch ingages the ac compressor and turns it and takes about two to five horsepower to pull the ac compressor and that uses more gas. you do get less gas milage with your windows down.
Reply:The a/c compressor has a clutch on it. When the a/c is off, the clutch lets the pulley turn without running the compressor. As far as mileage goes, in city driving it uses more fuel with a/c running. On the highway the aerodynamic drag from open windows uses more gas than running the a/c.
Reply:It's about the same either way. Be comfortable, the amount of fuel is not significant.
Reply:even though the serpentine belt does indeed turn the a/c compressor unit pulley when the engine is running, it has a form of clutch which engages when the a/c is switched on, which creates some drag on the engine, this will create more drag on the engine and thereby could increase gas consumption.
Reply:When the A/C is turned on the clutches on the compressor kick in. If you tried to turn the compressor with your hands, you couldn't! Driving the compressor takes alot of power from the engine. That's why there is a throttle step-up switch that kicks the throttle up when the A/C is turned on. So, yes, it does burn more fuel and it does rob horsepower. Other accessories like the alternator and power steering put a drag on the engine, just not as much at the A/C.


As far as the windows down...it does screw up the aerodynamics of the vehicle, but increased fuel use would be trivial.
Reply:As far as I am aware a/c does use more fuel when on in a car.
Reply:Yes the A/C will cost you in more gas. Why? Because the motor is working harder to drive the compressor. The compressor is electric operated through the plug-in you see at the rear of it or at the front of it. Once activated the compressor relies on the car motor to turn the belt to move the cool air into the cabin. Until the A/C is switched on inside the car the pulley the belt is turning is free-wheeling.
Reply:i always heard that it used more gas
Reply:Your mom is correct. It places an extra load on the motor. Though the belt does spin, when the AC is off, the clutch is dsengaged.





When it is engaged, it adds drag.





The windows could go either way and is predicated on the body style of the vehicle.





Trucks with tail gates down reduces a vortex of concentrated air turbulance at one spot and spreads it over a larger area, thereby increasing drag and costing more gas consumption...


A simple C++ programing using ARRAYS STRUCTS and CLASSES?

Hi. I am a C++ Student in college, enrolled in a simple C++ programming course. In class, the lectures have been about Arrays, Structs and Classes. My professor assigned a program that (to me) is IMPOSSIBLE. I CANNOT FIGURE IT OUT. Before I describe this project, I DO NOT, repeat, DO NOT want a program written. I would, however, like a guideline that puts me in the right direction. As of now, I have no clue how to even begin. Any kind of input, big or small, (even a little encouragement) is GREATLY appreciated.





Here is the project:





Write an object-oriented program that can be used by a small theater to sell tickets for its performances. The auditorium has 15 rows of seats, with 30 seats in each row. (I would probably make a multi-dimensional array here, I'm assuming.. int seats [15][30].. ? ). Design and create class called Theater to encapsulate the functionality specified below.

A simple C++ programing using ARRAYS STRUCTS and CLASSES?
Well you're on the right track.





For reading the prices make a double array.


in_stream %26gt;%26gt; priceArray[integer];


Keep getting values as long as you haven't reached the end of the file. Increment the integer so the next price will be put in the next array element.





====================


Seats that are available are represented by the # symbol, whereas those that are taken are represented by an * symbol.





This will make your seats array of chars. Set all the values = to # by default. When a seat is bought, change the symbol.


===================


Seems like your constructor should take as parameters the number of row, columns and the price array.





==================


Put your switch menu in a do-while loop. Keep running until they choose option 7.


=================


To purchase tickets, the user must enter the row and seat number of the desired seats. Do not accept row or seat numbers that do not exist. In addition, do not sell seats more than once: when the user reque





When they buy, check the char of the seat. If * then tell them it is already taken. If available, then update your variables.


How can I find the minimum, maximum, and average numbers of a thousand integer array in c++? (using functions)

I have an assignment in my comp sci c++ class and i cant figure out how to find the min, max, or average of 1000 integers in an array. I completed the rest of the program but I'm really stuck on this part of it.

How can I find the minimum, maximum, and average numbers of a thousand integer array in c++? (using functions)
graphing calculator will solve it in like a second
Reply:Define the min, max, and sum of the array as the value of the first element.


Iterate through the rest of the array, replacing the then-current min with any smaller value you find, replacing the then-current max with any larger value you find, and adding each element's value to the sum. When you've finished iterating, you'll have the min and the max, and the average will be the sum divided by the number of elements.





Since this is schoolwork, code is left to the coder.


I am looking for a term-paper small business in the philippines w/c using a simulation?

a small business in the Philippines with brief background, how they start, what is their mission, vision, goals and plans, and using a hand computed simulation

I am looking for a term-paper small business in the philippines w/c using a simulation?
Go have a look at http://encenada.com it is a Beach Resort there in Puerto Galera - a small business on a private beach

nobile

How do I change the font of a text box made using CreateWindow in c++ using the windows api?

This is the code I'm using to make it now:


hWndEditBox = CreateWindow(


"EDIT",


"",


WS_VISIBLE | WS_CHILD,


0,


0,


200,


20,


hWnd,


(HMENU)IDC_EDITBOX_TEXT,


(HINSTANCE)GetWindowLong


(hWnd, GWL_HINSTANCE),


NULL);

How do I change the font of a text box made using CreateWindow in c++ using the windows api?
HFONT hFont = CreateFont(.......);


SendMessage(hWndEdit, WM_SETFONT, (WPARAM)hFont, TRUE);





Make sure hFont has the same scope as hWndEdit and use DeleteObject() to delete the hFont before calling DestroyWindow(hWndEdit) ;.
Reply:Microsoft's documentation on this is cryptic, but they claim you can change only the color of the control:





http://msdn2.microsoft.com/en-us/library...


How do you generate a 10x10 multiplication table in C# using for statements?

A console application that accepts an input as an integer (n). Then displays a 10x10 multiplication table beginning from n using for or while statements.

How do you generate a 10x10 multiplication table in C# using for statements?
using System;


using System.Collections.Generic;


using System.Text;





namespace ConsoleApplication2


{


class Program


{


static void Main(string[] args)


{


Console.Write("Please enter an integer to generate a" + "multiplication table for: ");





int num = int.Parse(Console.ReadLine());





for (int i = 0; i %26lt; 10; i++)


{


for (int j = 0; j %26lt; 10; j++)


{


Console.Write((num + i) * (num + j) + "\t");


}


Console.Write("\n");


}


}


}


}


Figuring out if input is a Prime Number in C using loop?

I need to know if an integer the user inputs is a prime number. There is no limit to the value the user can input.


How do I do this?





Take note that this is just for C.

Figuring out if input is a Prime Number in C using loop?
i presume you are trying to get others to do your homework for you. anyways, let me start you off with the definition of a prime number. if a natural number is not a multiple of another natural number then its a prime. so a simple way is to in a loop divide it with each number less than it and see if there's a remainder.
Reply:I dont know the code for C but the argument should be whether it can be divided by itself or 1 only.


So having res values (5.12345)in the answer when dividing should be your key factor.





Alternatively you can hard code the prime factors and then cross check against them (not recommendable i suppose)
Reply:this is how I usually do it (may not be the best method)


If you are going to be calling this function a lot, it would be a good idea to store known primes in a vector or array and check the input against it before running this function.





code: http://rafb.net/p/obo7Zd18.html
Reply:If there is no limit to the input value, you will have to be able to store and test values greater than the maximum of the longest integer type available on your compiler, no matter what that is. As a first step, you can write your own functions to do arithmetic between numbers stored as sequences of decimal digits in character strings, then use those functions to divide the user's input by all possible divisors until the remainder is zero (input is not prime) or the quotient is less than the divisor (input is prime), whichever happens first.





As a first improvement, after testing for division by 2 and 3, start the divisor at 5 then increment it by 2 and 4 alternately. This will avoid trying divisors which are multiples of 2 or 3.





Even that method will run out of steam on input numbers of 18 or 20 digits. For larger numbers, check Chris Caldwell's prime pages at the link below. They are the best resource on the whole worldwide web for anything to do with prime numbers, but the methods which he refers to for proving the primeness of large numbers are using deep theoretical stuff that is understood by very few mathematics students even at university.


How we can print a file in c# using printpreviewdialogue?

i am using vs.net 2003,i want to print the text displayed in a textbox,text is also present in a file,actully i m trying to make atext editor like note


pad

How we can print a file in c# using printpreviewdialogue?
This should help:





http://msdn2.microsoft.com/en-us/library...

hibiscus

How do i add values to an array in C++ using a function.?

I have a set of values that i read into an array using a function earlier on, now i need to add additional values to the end of the array. hot do i go about doing that.

How do i add values to an array in C++ using a function.?
probably u had used a loop for earlier reading ,


then here's how it goes . i'll show an example.


#include%26lt;iostream.h%26gt;


void main()


{int a[20],i,n,m;


cout%26lt;%26lt;"\n How many elements ?";


cin%26gt;%26gt;n;


for(i=0;i%26lt;n;i++)


{


cin%26gt;%26gt;a[i];


}


cout%26lt;%26lt;"\n How many elements do you want to add ?";


cin%26gt;%26gt;m;


for(;i%26lt;n+m;i++)


cin%26gt;%26gt;a[i];


}





the idea here is , u hav executed for loop for the first reading , so u dont change the value of i that ws updated when it ws in the loop. Further reading takes place frm wer it ws stopped. Bt ur array size should be such that it can accomodate m+n elements
Reply:These are some way you can do


1. new array with maximize size array[MAX] and int _array_len variable.


Ex: len = 2;


buffer = new[len];


//TODO: init value


when u want to add value then just increase len++


buffer[len++] = value;


2. You should use collection like List or ArrayList





I hope it can help