473,396 Members | 1,780 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

calculate values code corrections

How can i rewrite the following code correcting all problems found

void calculatevalues (const int &a, float *b, int &c)

{
d = 20.4;

if (*a =0)

*a += 1
c = a +d;

else

b= c/d ;

c= a- b +d;

}

Hint if a =4, b =0.0 and c=5 when this function is called, their values when this fucntion returns should be a=4, b=0.25 and c= 24.15
Feb 8 '07 #1
1 1430
sicarie
4,677 Expert Mod 4TB
How can i rewrite the following code correcting all problems found

void calculatevalues (const int &a, float *b, int &c)

{
d = 20.4;

if (*a =0)

*a += 1
c = a +d;

else

b= c/d ;

c= a- b +d;

}

Hint if a =4, b =0.0 and c=5 when this function is called, their values when this fucntion returns should be a=4, b=0.25 and c= 24.15
What have you tried on this? Can you post your answer? What error messages have you gotten? (People are more likely to help if they see that you have actually tried, instead of you just copying and pasting your homework to try to get us to do it.)
Feb 10 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: crispy | last post by:
Hello group, I'm again having trouble putting ASP records INSIDE html link. Here's the string I put inside Access field: No room number specified (<a...
11
by: David | last post by:
I am learning plsql. I would like to run a stored procedure to calculate my bank account value by predicted 10% annual growth rate. Below is my plsql that is having problems. Your help is highly...
1
by: Building Blocks | last post by:
Hi, All I need is a simle calculate form script which contains this: A script that can handle text input, radio buttons, checkboxes, and dropdowns. Each one of these variables will contain a...
53
by: Cardman | last post by:
Greetings, I am trying to solve a problem that has been inflicting my self created Order Forms for a long time, where the problem is that as I cannot reproduce this error myself, then it is...
5
by: kux | last post by:
Hello everyone, I hope someone is out here who can help me with a simple calculation... I have a sales data base in access with monthly sales history by product. to make future predictions I...
6
by: luanhoxung | last post by:
dear all!! i met the headache problem in setting value for some controls in my form. i have 2 combo box in form F1. i want to set value for some textbox in F1 when i choose value from 2 combo...
5
by: =?Utf-8?B?QmlnU2Ft?= | last post by:
I've a ListBox with the Selection Mode set to Multiple. I want to use the Selected values as the WHERE Parameters in a SQL Data Source. If I set the SQL Data Source to use the Selected Value of the...
3
by: coolguyraj | last post by:
I have a javascript code to take value from two text boxes and calculate on triggering the "OnBlur" function and display in the third box. The code works fine with one line item,If i have more...
11
by: Thomas | last post by:
Hi, I'm pretty new to the programming world. I got stuck in the following problem. Please guide me about it. Well I'm trying to get the value of (128^100)^2 I've used long double type but to no...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.