前置条件,后置条件和循环值 [英] precondition, postcondition, and loop values

查看:389
本文介绍了前置条件,后置条件和循环值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要前提条件,后置条件,断言语句和声明的常量的帮助。

int second_in_minutes(int minutes);


//前提条件:秒> = 0

//后置条件:返回值是以分钟为单位的秒数。

2.an断言此函数的语句

断言(秒> ; = 0);

3.declared常量用于执行此函数

const int seconds = 60;

return seconds-分钟* 60;


这是正确的吗?

请帮帮我

i need help for precondition,postcondition,assert statement and declared constants .
int second_in_minutes(int minutes);

// precondition:seconds>=0
//postcondition: the return value is the seconds in minutes .
2.an assert statement for this function
assert(seconds>=0);
3.declared constants be used in the implementation of this functions
const int seconds = 60;
return seconds- minutes*60;

is this correct?
please help me

推荐答案


i需要前提条件,后置条件,断言语句和声明的常量的帮助。

int second_in_minutes(int minutes);


//前置条件:秒> = 0

//后置条件:返回值是以分钟为单位的秒数。

2.an断言此函数的声明

断言(秒> = 0);

3 .declared常量用于执行这个函数

const int seconds = 60;

返回秒 - 分* 60;


这是正确的吗?

请帮助我
i need help for precondition,postcondition,assert statement and declared constants .
int second_in_minutes(int minutes);

// precondition:seconds>=0
//postcondition: the return value is the seconds in minutes .
2.an assert statement for this function
assert(seconds>=0);
3.declared constants be used in the implementation of this functions
const int seconds = 60;
return seconds- minutes*60;

is this correct?
please help me



这是你第五次发布这个问题 - 仍然没有显示你有没有尝试过你自己?


看起来你已经在第一个做了笔记 - 你认为答案是对其他人的?

Is this the fifth time you have posted this question - still without showing you have attempted it yourself?

It looks like you have made notes on the first - what do you think the answers are to the others?



这是你第五次发布这个问题 - 仍然没有显示你自己尝试过吗?


看起来你做了笔记第一个 - 您认为答案是针对其他人的?
Is this the fifth time you have posted this question - still without showing you have attempted it yourself?

It looks like you have made notes on the first - what do you think the answers are to the others?



如果你看,他已经提供了答案,他正在与我们核实这些是否正确。


乍一看,巴恩,你的答案看起来很好。我建议更改常量的名称以遵循标准,并且更具可读性 - 而不是秒,在SECONDS_PER_MINUTE中命名。常量通常都是大写的,现在名称准确地描述了它的用途。

If you look, he has provided answers, and he is checking with us to see if these are correct.

At first glance, bhan, your answers look good. I would suggest changing the name of your constant to follow standards and be more readable - instead of seconds, name in SECONDS_PER_MINUTE. Constants are usually all uppercase, and the name now accurately describes its purpose.


我仍然是最好的。我不确定这些是否有更正。
i m still tring my best. i m not sure those r corrects or not.


这篇关于前置条件,后置条件和循环值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆