Jump to content

Need help with programming class!

Noligion

So, I'm taking a programming class and I don't know even the basics when it comes to the infrastructure of programming. I'm on my third assignment and have no idea what to do.

I need to correct the errors in this statement:

1. Set Real textbookAuthor = "Tony Gaddis" 2. Set String courseValue = CIT120

3. Set 42.5 = Real hoursWorked

4. Set String my Answer = “ “

5. Set Real payRate = $8.25 6. Set Integer ABSOLUTE_ZERO = -273.15 7. Set String totalPay = 0.0 8. Set Real Index = 1

9. Set PI = 3.1416

10. Set Real discountAnswer = “Yes"

I don't even know where to begin. PLEASE HELP! I don't want the answer, just a vivid description of how to do it!

Link to comment
Share on other sites

Link to post
Share on other sites

Hey. What language are you programming in, I would need to know that before I can help.

Link to comment
Share on other sites

Link to post
Share on other sites

I think doing homework here is a mistake. This is something that should be brought to his or her professor/tutor.

I have a 2019 macbook pro with 64gb of ram and my gaming pc has been in the closet since 2018

Link to comment
Share on other sites

Link to post
Share on other sites

So, I'm taking a programming class and I don't know even the basics when it comes to the infrastructure of programming. I'm on my third assignment and have no idea what to do. I need to correct the errors in this statement:

1. Set Real textbookAuthor = "Tony Gaddis"

2. Set String courseValue = CIT120

3. Set 42.5 = Real hoursWorked

4. Set String my Answer = “ “

5. Set Real payRate = $8.25

6. Set Integer ABSOLUTE_ZERO = -273.15

7. Set String totalPay = 0.0

8. Set Real Index = 1

9. Set PI = 3.1416

10. Set Real discountAnswer = “Yes"

I don't even know where to begin. PLEASE HELP! I don't want the answer, just a vivid description of how to do it!

We need to know what the language is, all languages have different syntax, I think you might have been.. not listening in class if your given this and don't know where to begin.

However to address the list the first thing to try is searching the keywords in the statements, for example 'Real' is the data type of the statement, a quick google will tell you it is used "in a computer program to represent an approximation of a real number(real number is something like PI which needs an approximation to be used)". Therefore in 1 it is incorrect to make a real value a string of text.

Assignment statements always go like so

datatype variablename = value

Again I say you must not have been listening because this sounds like a quiz to content recently taught but tell us the language and I guess we can explain why for each line

Link to comment
Share on other sites

Link to post
Share on other sites

I think no. 3 should be: Set RealHoursWorked = 42.5

But like others have said we don't know the language so I'm not 100% sure.

if you don't know what you're doing by your 3rd assignment I think you should probably seek help from your teacher...It looks like a basic problem set.

​Have you been going to lectures or practicing at all?

Link to comment
Share on other sites

Link to post
Share on other sites

So, I'm taking a programming class and I don't know even the basics when it comes to the infrastructure of programming. I'm on my third assignment and have no idea what to do. I need to correct the errors in this statement:

1. Set Real textbookAuthor = "Tony Gaddis"

2. Set String courseValue = CIT120

3. Set 42.5 = Real hoursWorked

4. Set String my Answer = “ “

5. Set Real payRate = $8.25

6. Set Integer ABSOLUTE_ZERO = -273.15

7. Set String totalPay = 0.0

8. Set Real Index = 1

9. Set PI = 3.1416

10. Set Real discountAnswer = “Yes"

I don't even know where to begin. PLEASE HELP! I don't want the answer, just a vivid description of how to do it!

We need to know what the language is, all languages have different syntax, I think you might have been.. not listening in class if your given this and don't know where to begin.

However to address the list the first thing to try is searching the keywords in the statements, for example 'Real' is the data type of the statement, a quick google will tell you it is used "in a computer program to represent an approximation of a real number(real number is something like PI which needs an approximation to be used)". Therefore in 1 it is incorrect to make a real value a string of text.

Assignment statements always go like so

datatype variablename = value

Again I say you must not have been listening because this sounds like a quiz to content recently taught but tell us the language and I guess we can explain why for each line

I have no lectures, my college does not offer in class programming classes, so I am forced to take it online in an environment that is extremely hard to learn. Literally forced, this class is required before I begin any others.
Link to comment
Share on other sites

Link to post
Share on other sites

So, I'm taking a programming class and I don't know even the basics when it comes to the infrastructure of programming. I'm on my third assignment and have no idea what to do. I need to correct the errors in this statement:

1. Set Real textbookAuthor = "Tony Gaddis"

2. Set String courseValue = CIT120

3. Set 42.5 = Real hoursWorked

4. Set String my Answer = “ “

5. Set Real payRate = $8.25

6. Set Integer ABSOLUTE_ZERO = -273.15

7. Set String totalPay = 0.0

8. Set Real Index = 1

9. Set PI = 3.1416

10. Set Real discountAnswer = “Yes"

I don't even know where to begin. PLEASE HELP! I don't want the answer, just a vivid description of how to do it!

We need to know what the language is, all languages have different syntax, I think you might have been.. not listening in class if your given this and don't know where to begin.

However to address the list the first thing to try is searching the keywords in the statements, for example 'Real' is the data type of the statement, a quick google will tell you it is used "in a computer program to represent an approximation of a real number(real number is something like PI which needs an approximation to be used)". Therefore in 1 it is incorrect to make a real value a string of text.

Assignment statements always go like so

datatype variablename = value

Again I say you must not have been listening because this sounds like a quiz to content recently taught but tell us the language and I guess we can explain why for each line

that does not help... what language are you working in....

CPU: i7 4770k | GPU: Sapphire 290 Tri-X OC | RAM: Corsair Vengeance LP 2x8GB | MTB: GA-Z87X-UD5HCOOLER: Noctua NH-D14 | PSU: Corsair 760i | CASE: Corsair 550D | DISPLAY:  BenQ XL2420TE


Firestrike scores - Graphics: 10781 Physics: 9448 Combined: 4289


"Nvidia, Fuck you" - Linus Torvald

Link to comment
Share on other sites

Link to post
Share on other sites

If you are in C, instead of using Set PI = 3.1416 you can use M_PI as long as you use #include before your main. Everyone else is correct though, without knowing what language you are coding in there is little we can do to help. Also where you said "Set Integer ABSOLUTE_ZERO = -273.15 7", this cannot be an integer as integers are only whole numbers and with this number I'm sure it's relating to degrees Kelvin for a conversion to Celcius. Any value with a decimal place has to be set as something else. I know you can use "double variable_name_here = -273.15;" and that could allow you use it in any equation you want to do. If you set -273.15 to be an int(integer) then it truncates the decimal places off and you are stuck with -273 for your value. Also if you do any calculations with it your results will be skewed. Give us some more info if you want some real help.

Link to comment
Share on other sites

Link to post
Share on other sites

Here is an idea of how to initialize the variables you gave, I'm not sure what you're supposed to do with it after that but hopefully this helps.

#include

#include

#include

#define PI 3.14159 /*You can do this or use M-PI where ever you need to use PI in your equations and it will be more accurate*/

int main(void)

{

/*Initialize your variables*/

double real_hours_worked = 42.5;

double absolute_zero = -273.15;

double real_pay_rate = 8.25;

char string[] = "CIT120";

char string2[] = "Tony Gaddis";

char string3[10];

double real_index = 1;

double total_pay = 0.0;

/*Enter your print and scan statements here*/

return (0);

}

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×