Hello codecall forums,
My name is Ryan I'm a student studying programming in Portsmouth NH @ greatbay.edu I don't really know much about programming currently. I am enrolled in a class called Programming logic, we have just started with the basics making pseudocode programs. I think this class will touch on java in a few weeks.
Hope to get to know everyone here.
Thanks.
Question: Can you display data as a mathematical expression?
a=1 b=2
Display "the answer is", a+b "."
in theory would this display 3?
Set ryanw327 = "CoolNewguy"
Started by Ryanw327, Sep 26 2010 05:08 PM
2 replies to this topic
#1
Posted 26 September 2010 - 05:08 PM
|
|
|
#2
Posted 26 September 2010 - 06:02 PM
Welcome aboard, and yes, it would display 3 :)
#3
Posted 26 September 2010 - 08:01 PM
Thanks wp,
So we had to write this pseudo program that asked a user about car expenses. Here is what I came up with. I'm really enjoying this class, but I can't wait to get into some real programing.
So we had to write this pseudo program that asked a user about car expenses. Here is what I came up with. I'm really enjoying this class, but I can't wait to get into some real programing.
Module main () //Declare variables Declare real loanPayment, insurancePayment, gasPayment, oilPayment, tirePayment, maintenancePayment //Set or Assign Declare string Lp, Ip, Gp, Op, Tp, Mp Lp = “Loan” Ip = “Insurance” Gp = “Gas” Op = “Oil” Tp = “Tires” Mp = “Maintenance” loanPayment=0 insurancePayment=0 gasPayment=0 oilPayment=0 tirePayment=0 maintenancePayment=0 //Call Modules Call getMonthlyPayments(loanPayment, Lp) Call getMonthlyPayments(insurancePayment, Ip) Call getMonthlyPayments(gasPayment, Gp) Call getMonthlyPayments(oilPayment, Op) Call getMonthlyPayments(tirePayment, Tp) Call getMonthlyPayments(maintenancePayment, Mp) Call calcyearly(loanPayment, insurancePayment, gasPayment, oilPayment, tirePayment, maintenancePayment) End Module // end of main //Start modules getMonthlyPayments(Real ref amount, string paystring) Display “Enter the monthly cost of your”, paystring input amount end Module calcyearly(Real ref a, b, c, d, e, f) Display “the total monthly cost of all expenses is”, a+b+c+d+e+f Display “the total yearly cost of all expenses is”, (a+b+c+d+e+f)*12 end Module


Sign In
Create Account


Back to top









