Hi, I am trying to learn OOP with c++ with the help of Turbo C++ version 3.0 and "C++ Primer Plus" by stephen prata. according to the book, the NEW convention for including the iostream header file in c++ is in the following way: #include<iostream> but it causes an error saying : unable to open include file "IOSTREAM" however the following code works: #include<iostream.h> but it is supposed to be the OLD convention Moreover , according to the book, it is necessary to use the following: using namespace std so that we can use cout and cin directly without having …

Member Avatar
Member Avatar
+0 forum 6

Please, i need a teacher to help me out...i am at the intro stage and i was wondering if someone would walk me through this please..i would appreciate it. Mr. Clark employs students who are exempt from taxes and others who are not. Write a program that will calculate and display weekly wages. If an employee is not exempt, 18% will be deducted from gross wages, otherwise “NO TAXES DEDUCTED” will be displayed. Two program runs are shown below: Enter hours worked: 45 Enter hourly rate: 10.00 Exempt (Y/N)? Y Gross wages = $475.00 NO TAXES DEDUCTED Enter hours worked: …

Member Avatar
Member Avatar
+0 forum 9

I need to write a program that reads data from a text file, and prints it. These are the specifications. And then manipulate the program to determine this: -The number of uppercase letters in the file -The number of lowercase letters in the file -The number of digits in the file -The number of whitespace characters in the file I really need help doing this, it has to pertain to strings, but also basic concepts of Python. Im at a begginners skill level, and Im stuck. Much help would be GREATLY appreciated, thank you!

Member Avatar
Member Avatar
+0 forum 5

Hello Guys I am looking for some code,that can help me to build a C# method that can generate a photo mosaic (a big picture that is build up from other pictures) but really i dont have idea how can i do this. :S Thanks for all your help :D

Member Avatar
Member Avatar
+0 forum 5

I was wondering if it is possible to make [I]an online multi-player game server preferably in batch.[/I] I am hoping to make a PowerPoint game that can be multi-player with the help of batch. Also even answers that do not suit my requirements fully will help, because i am 11 years old and this is about all I know of batch script: @echo off @echo on echo (%time%) (%date%) (%Computername%) (%Username%) cls dir /s del ren rename title color echo. ping localhost -n (number in seconds) >nul pause start (path) (or filename.extension if the file is in the same folder) …

Member Avatar
Member Avatar
+0 forum 15

Hello! I have to print patterns using '*' and I am at a loss how to get these patterns printed! I figured out the first one, * ** *** **** ***** ****** ******* ******** ********* ********** and now i have to do it upside down: ********** ********* ******** ******* ****** ***** **** *** ** * and backwards: ********** _********* __******** ___******* ____****** _____***** ______**** _______*** ________** _________* and _________* ________** _______*** ______**** _____***** ____****** ___******* __******** _********* ********** this is the code i have for the first one: [CODE] for (int i =0; i < 10; i++) { for (int …

Member Avatar
Member Avatar
+0 forum 16

Any ideas of how I can have a calendar for all 12 months print for any year? The user inputs the year and the day of the week for January 1st of that year. (Sunday = 0, Monday = 1, etc.) *Important*: I cannot use cases. (That's what I've mostly seen online to solve this problem) I can only use <iostream>, no other libraries. And I am supposed to use two for loops. Could someone provide a pseudocode or any suggestions?

Member Avatar
Member Avatar
+0 forum 10

When the user's mouse pointer touch a button I want a message to appear telling the user what that button's function is. Wich function do I use? Thanks

Member Avatar
Member Avatar
+0 forum 4

plz can any one help me.. i need it 2night

Member Avatar
Member Avatar
+0 forum 9

hello, so i am having some problem x = 50; y = 31; //declaration from line 1 to 5 lastx = x; lasty = y; while(1 == 1) { gotoxy(lastx, lasty); printf(" "); gotoxy(x,y); printf("**|_A_|**"); a = getch(); lastx = x; lasty = y; if (a == 77) x = x + 1; if (a == 75) x = x - 1; } //--------------------------------------------------------------------- //i am facing problem here, i have these two codes but when i try to run only the character movement peice of code works, which is above this comment and the rand wont work which is …

Member Avatar
Member Avatar
+0 forum 5

So the code is this but I can't figure out the problem. I included the error alongside with it. using System; public class SavingAccount { public static decimal interestRate = 0.02M; public string Name { get; set; } public decimal Balance { get; set; } public SavingAccount(string n) { Name = n; } public SavingAccount(string n, decimal b) { Name = n; Balance = b; } public void DisplayInfo() { Console.WriteLine("Account name: {0}\nAccount balance: {1}\nInterest Rate: {2}", Name, Balance, interestRate); } } public class Testing { public static void Main(string[] args) { SavingAccount acct1 = new SavingAccount("Peter Chen"); SavingAccount acct2 …

Member Avatar
Member Avatar
+0 forum 4

For my Java homework I had to make a program that simulates 100,000 people going 25 times around a monopoly board and finding the percentage times a space is landing on. I get this error when I run it. Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 39 at Monopoly.analyze(Monopoly.java:86) at TestMonopoly.main(TestMonopoly.java:6) Here is my main code. public class Monopoly { String[] names = new String[39]; Dice roller = new Dice(); final int numPlayers = 100000; final int timesAround = 25; public void setUpBoard() { names[0] = "Go"; names[1] = "Mediterranean Avenue"; names[2] = "Community Chest"; names[3] = "Baltic Avenue"; names[4] = "Income …

Member Avatar
Member Avatar
+0 forum 4

I used to have turbo c++ but it is outdated now, so the only problem i am having with that is that there was a great help documentation in turbo c++ for the language and i could just browse to any function of c++ and get its details. After turbo c i am not able to get that kind of help anywhere or in any compiler. Can anyone plz tell me where can get that kind of c++ help ?

Member Avatar
Member Avatar
+0 forum 9

So i have a code for a menu and i am facing some problem.. code:- do { ch = getch(); switch(ch) { case 'W': case 'w': system("CLS"); cout<<" MOD v1.0\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"; cout << " --> PLAY\n\n"; cout<<" HELP\n\n"; cout<<" EXIT\n\n"; break; case 'E': case 'e': system("CLS"); cout<<" MOD v1.0\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"; cout << " PLAY\n\n"; cout<<" --> HELP\n\n"; cout<<" EXIT\n\n"; break; case 'R': case 'r': system("CLS"); cout<<" MOD v1.0\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"; cout << " PLAY\n\n"; cout<<" HELP\n\n"; cout<<" --> EXIT\n\n"; break; } }while (ch != 'Q' && ch!='q'); so what is want is that when I press enter it should take me to a new …

Member Avatar
Member Avatar
+0 forum 2

So I have made a menu and a guy helped me, We have used enum in the menu is there anyother way i can do it, cause my teacher is not allowing me to use classes, files and arrays, please help, if u guys have anything simple and better i need it urgently.. here is the code:- enum MenuState{MenuPlay,MenuHelp,MenuExit}; // the idea of using enum is that instead of using an int to represent a set of values, a type with a restricted set of values in used instead. MenuState ms=MenuPlay;cout<<" *-=MOD=-* v1.0\n\n\n\n\n"; char ch=0;//or anything other than '\r' while …

Member Avatar
Member Avatar
-1 forum 1

is there an easier way to write this code?? without using enum, enum MenuState{MenuPlay,MenuHelp,MenuExit}; MenuState ms=MenuPlay; char ch=0;//or anything other than '\r' while (ch!='\r')//IIRC getch returns '\r' when user hits enter { switch (ms) { case MenuPlay: cout<<"--> PLAY\n HELP\n EXIT\n"; break; case MenuHelp: cout<<" PLAY\n--> HELP\n EXIT\n"; break; case MenuExit: cout<<" PLAY\n HELP\n--> EXIT\n"; break; default: //always provide default, some compilers will not compile until it is there cout<<"ERROR: Unknown state!\n"; } ch=getch();//process more input switch (ch) { case 'w': case 'W': ms=MenuPlay; break; case 'e': case 'E': ms=MenuHelp; break; case 'r': case 'R': ms=MenuExit; break; default: } } …

Member Avatar
Member Avatar
+0 forum 2

Alright I apologize for the completely uninformative title but i had no idea what to call it. Basically I have an array with multiple values and I only want information to be sent from certain forms if a certain value is met in the array. <?php if(isset($_POST['cb1'])) { $cb1 = implode(",", $_POST['cb1']); } else { $cb1 = ""; } ?> <?php if(isset($_POST['cb2'])) { $cb2 = implode(",", $_POST['cb2']); } else { $cb2 = ""; } ?> <?php if(isset($_POST['tutor'])) { $tutor = implode(",", $_POST['tutor']); } else { $tutor = ""; } ?> <?php $con = mysqli_connect("localhost","root","admin","form_info"); if (mysqli_connect_errno()) { echo "Failed to …

Member Avatar
Member Avatar
+0 forum 5

I know I asked this before, so I appologize but I just need to write this program for an extra credit assignment and frankly I don't know a thing about arrays and don't have time to learn since I have another final coming up so if anyone could be so kind as to show me a basic outline or anything of the following: "Write a program that will read a line of text that ends witha period, which serves as a sentinal value. Display all the letters that occur in the text, one per line and in alphabetical order, along …

Member Avatar
Member Avatar
+0 forum 2

hello everyone i was wondering if you guys can help me.. i am really tired i havent slept for 2 days trieng to figure out how to do this i am a begginer in this and my prof asked me a game which is http://www.miniclip.com/games/fat-slice/en/ he wants it in c language using the 20 years old graphics winbgim... ok so i didnt know where to start he told me to declare an array of 0s and draw a shape inside of it in 1s(rectangle for ex) and put the ball inside of it if the ball hits 0s let it …

Member Avatar
Member Avatar
+0 forum 2

Hi, So I am working on a drink machine simulation. I have a text file that holds the prices, names and inventory. My problem is It won't let me set my prices at 1.00 or higher. Ex: I set the price to 1.50 in the text file then when the program reads the info from the text it will only read the cents so instead of 1.50 it will read .50 textfile looks like this: Apple Juice 1.50 20 Mango Juice 1.50 20 Sprite Mix 1.90 20 Coca Cola 1.90 20 my code: #include <iostream> #include <string> #include <fstream> #include …

Member Avatar
Member Avatar
+0 forum 4

I am trying to do a Page to PHPExcel to user fill an Html Page and send to PHP and it will: Open my default Excel Page and after fills the Excel Page with information send by Html What i dont know is how to do it read if is monday or thuersday etc and if is not holiday or lay-off(im started trying with If's) and color it in how much modules are introduced (can be like max 10 modules(each module is like a matter of each discipline)) and each block of time have 90minutos and each module will fill …

Member Avatar
Member Avatar
+0 forum 6

Well this is quite a large program so there is a lot of information to sort through, but when I compile it now it comes up with this: /Users/Adam/Adam's Work/Programming/C++/Code/OS2.cpp: In member function ‘virtual int dbase::todo()’: /Users/Adam/Adam's Work/Programming/C++/Code/OS2.cpp:393: error: invalid conversion from ‘const char*’ to ‘int’ /Users/Adam/Adam's Work/Programming/C++/Code/OS2.cpp:394: error: invalid conversion from ‘const char*’ to ‘int’ /Users/Adam/Adam's Work/Programming/C++/Code/OS2.cpp:420: error: a function-definition is not allowed here before ‘{’ token /Users/Adam/Adam's Work/Programming/C++/Code/OS2.cpp:4034: error: expected `}' at end of input /Users/Adam/Adam's Work/Programming/C++/Code/OS2.cpp:4034: error: expected `while' at end of input /Users/Adam/Adam's Work/Programming/C++/Code/OS2.cpp:4034: error: expected `(' at end of input /Users/Adam/Adam's Work/Programming/C++/Code/OS2.cpp:4034: error: expected primary-expression …

Member Avatar
Member Avatar
+1 forum 12

Hello, I am making a 2d shooter game, and I dont knnow how to make the player's ship move left and right with left and right arrow keys... please help me. I have to finish this project before 6th... please help

Member Avatar
Member Avatar
+0 forum 7

I am having a problem completing my program. I am sure it is a simple mistake. My results look something like this How many students do you have? 2 How many Exam grades do you have? 4 Enter a score for student number: 1 98 Enter a score for student number: 1 78 Enter a score for student number: 1 88 Enter a score for student number: 1 83 Enter a score for student number: 1 77 Enter a score for student number: 1 77 Enter a score for student number: 1 77 Enter a score for student number: 1 …

Member Avatar
Member Avatar
+0 forum 4

This is really stupid question and i feel ashamed to ask but i kinda have to. So here is the thing, in my college/school we got some sort of homework which isn't a "must do" but i wish to for myself, so thing we need to do is, when i activate undo button, it needs to change back to picture which was there after the new picture was added infinite ammount of times, for example if i change picture five times, it needs to undo the change five times and so on. And sadly i have no idea how to …

Member Avatar
Member Avatar
+0 forum 2

Hi I need help with something, I really don't know how to do this, but how would I add these questions in to VBA? could somebody tell me for atleast one. The net take-home income and other values are calculated as follows: 1) Calculate CPP and EI If annual income is greater than $48,600, then EI = $913.68 Otherwise EI = annual income * 1.88% If annual income is greater than $49,000, then CPP = $2425.50 Otherwise CPP = annual income * 4.95% 2) Calculate Federal Tax on taxable income (taxable income = annual income – CPP – EI)  …

Member Avatar
Member Avatar
+0 forum 2

I took the liberty of posting the assignment and the work I've done. I can't figure this one out, can anyone help me And I did put an attempt at this, almost 4 hours now and I'm burnt out. If anyone can help me I would soooo love you. "Your app should sell tickets until the plane is full. For each customer, ask how many seats he wants to buy. If the plane has enough seats available, ask the customer to enter the name of each passenger. If the plane does not have enough seats, tell the customer how many …

Member Avatar
Member Avatar
+0 forum 8

**i need someOne to solve for me all this Question as soon as possible he can** 1. Write a c program TO take a charcter from keyboard and find ASCII value of that character . Dialog box Enter a character k The ASCII value of k = 107 2. Write a program to swap two numbers without third variable. ex a = 12 and b = 20 before swap after swap a = 20 and b = 10 with out any other variable Dialog Box Enter value of a and b = 10 20 After Swap value of a and …

Member Avatar
Member Avatar
-2 forum 12

//random number generator var theDecimal = 0; function newProblem(){ theDecimal = Math.floor(Math.random()*256); //math.floor chops off decimals and rounds document.getElementById("startNumber").innerHTML = theDecimal; }

Member Avatar
Member Avatar
+0 forum 1

I'm quite new to programming and i'm trying to write a formula to work out the capacitance of capacitors - and is what I have below. I then want to convert the value I have (in pico farrads) into micro farrads. Here's what I have so far: while True: x=float(input("First number: ")) y=float(input("Second number: ")) z=float(input("Third number: ")) x=int(x) y=int(y) z=int(z) print(int(str(x)+str(y))*10**z) replay=input("Would you like to calculate again? (yes/no) ") print('\n') if replay=="no": print("...Terminated Program.") break print('\n') I want to assign the variable 'pf' to the result of line 11, so that I can then multiply the result by *10**-3. …

Member Avatar
Member Avatar
+0 forum 3

The End.