Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trevor
C++ programming with inheritance. HELP?
I fixed some of the issues I was having before but, still wont compile. First time using inheritance.
any help will be appreciated. I need make this work before i can move on to what i need to do next.
1 AnswerProgramming & Design5 years agoC++ programming help with inheritance?
This is my first time using inheritance. The new classes i added were hourly and salaried. I dont think i did this right at all. I keep getting errors.
1 AnswerProgramming & Design5 years agoHelp with C++ and classes with protected attributes.?
^
this is my code
The things I added were 2 classes, Salaried and Hourly. The issue I am having is when you make the classes I am supposed to call all the information from the employee class. Do i just copy and paste all of the setters and getters from the employee class and add it to Both Salaried and Hourly? We are suppose to add (if they are salaried the management lvl and change the calcpay to the formula i have for the Salaried calPay) (and if they are hourly add hourly wage, hours, category such as fulltime etc. and change the calcPay to the formula i have for Hourly calPay)
I understand that I am using the proper class for if they are Management or hourly, but I don't know how to go about adding the info from employee class.
also
for the hourly AnnualSalary, I have to make it calcPay*50. but I dont know how to call the sum of calcPay and use it in Annual Salary.
Any help will be appreciated.
1 AnswerProgramming & Design5 years agoNeed help with this arrays and class, C++ programming help.?
^ my code so far
I am trying to create a program that asks the user for students and saves the data into an array, then uses a loop to enter more students and same for displaying them. I am having an issue with the array. I have the Students Class working correctly, but not the Grade5 class.
1 AnswerProgramming & Design5 years agoProgramming help!. Having some issues getting this program to do compile correctly.?
^ code in link
The program wont allow me to create another object using the constructor with parameters. it keeps coming up with an error saying it doesn't match the argument list. In addition to that the program isn't reversing the for the second object, I have a feeling I'm going about doing it in the wrong way. And the last thing I can't figure out, I don't know what to put in the parenthesis for the classes in the second object. If i am initializing what the numbers are equal two when i create the class that what should go in there.
1 AnswerProgramming & Design5 years agoProgramming help. I got everything to work but i have no idea how to convert a char to string.?
It compiles but wont display when you enter gender and i am having trouble finding a way to convert the string to char so it will stop having errors. http://pastebin.com/UEhpPXf6
The link is where my code is.
Programming & Design5 years agoProgramming help. Won't enter the information into the class, and wont convert it to the correct data type when its needed.?
I needed to write a program where the first half you enter in the information for a class. Using the input1 cin, i can enter the first and last name but it only saves last name. and after that it errors out because it isn't converting the input string to the correct data type. any help will be much appreciated. the second employee information where you initialize the class info for George washington works perfectly fine.
The code is on this link...... http://pastebin.com/GwMGJq58
too big to post.
Programming & Design5 years agoWhen it goes through the loop and executes the program again it skips the ask the question input and goes straight to pick number. Why?
// CIS247 Homework 1, Part 1
// Programmer: Trevor England
// Purpose: Magic Eight-ball Program - user enters a yes/no question and then a number between 1 to 8; the program answers the question. End when user decides to (Q)uit.
//
#include <iostream>
#include <string>
using namespace std;
void main()
{
int number;
string question;
char space;
cout << "Welcome to the Magic Eight-Ball!\n\n\n";
do
{
cout << "Ask your question or Q to quit.\n";
getline(cin,question);
if (question != "Q" && question != "q")
{
cout << "Enter a number between 1 and 8.\n";
cin >> number;
cout << endl << endl << question << endl << endl;
switch(number)
{
case 1: cout << "It is certain.\n\n";
break;
case 2: cout << "Dont count on it.\n\n";
break;
case 3: cout << "Without a doubt.\n\n";
break;
case 4: cout << "Outlook good.\n\n";
break;
case 5: cout << "My sources say no.\n\n";
break;
case 6: cout << "Signs point to yes.\n\n";
break;
case 7: cout << "My reply is no.\n\n";
break;
case 8: cout << "You may rely on it.\n\n";
break;
default: cout << "Number must be between 1-8\n\n";
}
}
}while (question != "Q" && question != "q");
system("PAUSE");
}
Programming & Design5 years agoProgramming help, skips part of the program, asks and inputs first name, skips to city. Why?
#include<iostream>
#include<string>
using namespace std;
void getName(char &, char &, char &);
void getAddress(string &, string &, string &, int &);
void checkNew(char);
void displayInfo(char, char, char, string, string, string, int);
void main()
{
char firstName, middleName, lastName;
string street, city, state;
int zipCode;
getName(firstName,middleName,lastName);
getAddress(street, city, state, zipCode);
checkNew(firstName);
displayInfo(firstName,middleName,lastName,street, city, state, zipCode);
system("PAUSE");
}
void getName(char &first, char &middle, char &last)
{
cout << "Enter your first name: ";
cin >> first;
cout << "\n\nEnter your middle name: ";
cin >> middle;
cout << "\n\nEnter your last name: ";
cin >> last;
}
void getAddress(string &street, string &city, string &state, int &zip)
{
cout << "Enter your street: ";
getline(cin,street);
cout << "\n\nEnter your City: ";
cin >> city;
cout << "\n\nEnter your state: ";
cin >> state;
cout << "\n\nEnter your Zip Code: ";
cin >> zip;
}
void checkNew(char name)
{
char answer;
cout << "\n\nAre you a New Customer?(Y or N) ";
cin >> answer;
if (answer == 'y' || answer == 'Y')
cout << "\nWelcome " << name << endl;
if (answer == 'N' || answer == 'n')
cout << "\nWelcome back " << name << endl;
else
cout << "\nInvalid selection.";
}
5 AnswersProgramming & Design5 years agoWrongfully pulled over and give ticket please help!!!?
Today i was driving down a road with a 35mph speed limit. I frequently look at my speedometer and knew i was going about 36. A cop pulled me over and said i was going 65. I told him i knew i wasnt and he said he wouldnt have pulled me over then. He said my insurance was expired because he was reading the issued date, when i showed him it wasnt he got grumpy and told me just to keep it. he then said he smelled pot in my car and made me roll my windows down saying he would search my car. After he went around my car he just said that i may have been the breeze and continued the ticket. I didnt have my license on me so i got two tickets one for speeding and one for not have a licence on me. Both tickets have different pull over locations. And the one with the speeding has a location i was never at. I have to go to court and i have to have a lawyer due to the laws and ammount over im accused of speeding. I need to know how do i prove that i wasnt speeding. Its his word against mine at this point and i know for sure i wasnt. I want his dash camera footage and also the footage of places near where i was pulled over, but what else whould i do. This cop pulled me over and lied about me speeding. And this ticket can ruin my job.
2 AnswersLaw Enforcement & Police6 years agoCar airconditioner and heat not working, need help?
I have a 2000 Chevy Blazer. I know there is a short in the passenger door, but I don't really use that door so its fine unless i have to open it, then i just have to slam it shut, so it isn't much of an issue. The fans blow just fine, and my air conditioner works, for about 10 minuets before it just stops blowing cold air and starts blowing just air with a funky smell. With the heat though it doesn't blow hot air at all. It just blows air when i turn on the heat and doesn't even get warm at all. I need help trying to figure out the problem. If you have any idea what it might be please let me know.
I already know its probably not something easily fixed but at least this way i can tell the place i bring it to what it is seeing as they never found a problem with it. and there is no leak in the hoses.
2 AnswersMaintenance & Repairs8 years agoWhat is a good starting hookah?
I've decided that I'm going to get a hookah but I'm having trouble picking which one to get. I found some cool skull ones on amazon but the reviews sorta scared me off. I'm looking for a cool looking hookah, with two hoses, and for around $20. The color doesn't matter much but I do like green. Any help will be appreciated.
2 AnswersOther - Food & Drink8 years agoI need help making a function but keeping everything working.?
// File name: BaseBallsV2.cpp
// Author: Trevor England
#include <iostream>
using namespace std;
double Baseballs_price (int, double);
int main()
{
int count = 0;
int total_balls = 0;
double total_price = 0.0;
int number_balls;
double price_balls;
cout << "Enter the number of balls. To stop the program enter 0: ";
cin >> number_balls;
while (number_balls > 0)
{
{
cout << Baseballs_price ( number_balls, price_balls);
count ++;
total_price += price_balls;
total_balls += number_balls;
}
cout << endl;
cout << "Enter the number of balls. To stop the program enter 0: ";
cin >> number_balls;
}
cout << "\nTotal Balls: " << total_balls << endl;
cout << "Total Price: $" << total_price << endl;
cout << "Average balls: " << total_balls / count << endl;
cout << "Average price: $" << total_price / count << endl;
system("PAUSE");
return 0;
}
double Baseballs_price (int number_balls, double price_balls)
{
if (number_balls <= 12)
{
price_balls = number_balls * 25;
cout << "Number of baseballs: " << number_balls;
cout << "\nPrice: $" << price_balls << endl;
}
else if (number_balls <= 23)
{
price_balls = .90 * (number_balls - 12) * 25. + 12 * 25.;
cout << "Number of baseballs: " << number_balls;
cout << "\nPrice: $" << price_balls << endl;
}
else
{
price_balls = .80 * (number_balls - 24.) * 25. + .90 * (24. - 12.) * 25. + 12. * 25.;
cout << "Number of baseballs: " << number_balls;
cout << "\nPrice: $" << price_balls << endl;
}
}
This is my code. I had to make a function for the baseball price... I attempted it but then the averages and totals for the prices don't come out.
and this is the output that i get... the balls average and total works just not the price... and for some reason im getting a weird thing after each input. Help?
Enter the number of balls. To stop the program enter 0: 1
Number of baseballs: 1
Price: $25
1.#QNAN
Enter the number of balls. To stop the program enter 0: 5
Number of baseballs: 5
Price: $125
1.#QNAN
Enter the number of balls. To stop the program enter 0: 20
Number of baseballs: 20
Price: $480
1.#QNAN
Enter the number of balls. To stop the program enter 0: 15
Number of baseballs: 15
Price: $367.5
1.#QNAN
Enter the number of balls. To stop the program enter 0: 0
Total Balls: 41
Total Price: $0
Average balls: 10
Average price: $0
Press any key to continue . . .
1 AnswerProgramming & Design8 years agoI need help with finishing this program.?
// File name: BaseBallsV2.cpp
// Author: Trevor England
#include <iostream>
using namespace std;
int main()
{
int number_balls;
double price_balls;
cout << "Enter the number of balls. To stop the program enter 0: ";
cin >> number_balls;
while (number_balls > 0)
{
if (number_balls <= 12)
{
price_balls = number_balls * 25;
cout << "Number of baseballs: " << number_balls;
cout << "\nPrice: $" << price_balls << endl;
}
else if (number_balls <= 23)
{
price_balls = .90 * (number_balls - 12) * 25. + 12 * 25.;
cout << "Number of baseballs: " << number_balls;
cout << "\nPrice: $" << price_balls << endl;
}
else
{
price_balls = .80 * (number_balls - 24.) * 25. + .90 * (24. - 12.) * 25. + 12. * 25.;
cout << "Number of baseballs: " << number_balls;
cout << "\nPrice: $" << price_balls << endl;
}
cout << endl;
cout << "Enter the number of balls. To stop the program enter 0: ";
cin >> number_balls;
}
system("PAUSE");
return 0;
}
This is the first part done. Now i have to keep doing the same stuff as this program, and do the following:
1. display the total number of balls and the price per customers and the price paid,
2. display the grand sum of money collected from all customers,
3. display the average number of balls per customer and the average amount spent by customers,
4. display the average price per ball paid considering all balls sold.
This is where i'm lost. I don't know what to do to be able to track all the balls and prices to add them up at the end. I think i would need to do an array but i wouldn't even know where to start without changing how the original program runs. help me Finnish this?
1 AnswerProgramming & Design8 years agoI need help finishing this code with functions. Stuck?
// File: convTemp.cpp
// Author: Trevor England
// Description: Allows to convert from Celsius to Fahrenheit (c2f)
// and from Fahrenheit to Celsius (f2c)
//
#include <iostream>
using namespace std;
double f2c (double f2c);
double c2f (double c2f);
int main ()
{
// Welcome the user to the convTemp program. Explain the function, high level.
cout << "Welcome to Temperature converter!" << endl << endl;
cout << "Enter f for Fahrenheit to Celsius converstion, or" << endl;
cout << "Enter c for Celsius to Fahrenheit converstion" << endl;
cout << endl;
double fahrenheit, celsius;
celsius = f2c (fahrenheit);
fahrenheit = c2f (celsius);
char operation = 'c';
int testCount = 12;
while (testCount > 0)
{
// invite to enter the operation:
cout << "Test count: " << testCount;
cout << "\nEnter desired converstion: ";
cin >> operation;
// Enter c for c2f or f for f2c converssion
if (operation == 'c' || operation == 'C')
{
}
else if (operation == 'f' || operation == 'F')
{
}
else
{
}
testCount --;
cout << endl;
}
cout << endl;
system ("PAUSE");
return 0;
}
char operation = 'c';
double f2c (double f)
double c2f (double c)
{
if (operation == 'c' || operation == 'C')
return 5./9. * (f - 32.);
else if(operation == 'f' || operation == 'F')
return 9./5. (c + 32.);
else
cout << "Error - operation code (" << operation << ") should be c or f\n\n";
cout << "Program terminating\n\n";
}
This is my C++ code, I had the program finished and working but now we have to use functions in it and rewrite the code using those functions we made. But i've hit a block, i'm not sure how to go from here. I am also using Dev C++.
1 AnswerProgramming & Design8 years agoNeed a new gamertag for xbox, something cool maybe realted to celtic, irish, or german history.?
I have been wanting to change it for awhile but when it comes to thinking of something I space out. I want it to be awesome and unique. I was looking at horseman of death in Latin, or Dullahan the Irish headless horseman but I need some cool ideas, I like mythology and death realted stuff. Please help me come up with badass g-tag. Also I like historical stuff if that helps
2 AnswersMythology & Folklore8 years agoI need a new gamertag, something celtic,irish, or german.?
I have been wanting to change it for awhile but when it comes to thinking of something I space out. I want it to be awesome and unique. I was looking at horseman of death in Latin, or Dullahan the Irish headless horseman but I need some cool ideas, I like mythology and death realted stuff. Please help me come up with badass g-tag.
4 AnswersVideo & Online Games8 years agoComputer start up problem, how do I fix it? IMPORTANT?
My computer went crazy a yeaturday, something got in my computer and ruined most of my files so I had to system recovery and get rid of everything, this was when it wouldn't start up, it would just show the hp logo for about a sec and then just a black lit up blank screen. Once recovered it, it worked again. I regot some of my programs like iTunes etc. And then had to shutdown to do some system updates. Once I did that, it dis the previous problem. Wouldn't start up. It will show the hp symbol for 1 sec enough time for me to hit escape and get the the recover menue. I tried recovering um it it's no use. I really dont want to do recovery again and loose everything again. Can anyone please tell me how to fix this. Thanks.
1 AnswerSoftware10 years agoWhat is Trevor England written elvish?
I'm want to get a tattoo and elvish looks really cool so I want my name written in it. I looked but couldn't find it. Help me out.
3 AnswersLanguages1 decade ago