If else语句将不会执行
if else statements will not execute
我在写"if" "else"语句时遇到了麻烦,但是当我运行程序时它不会执行。
#include <iostream>
using namespace std;
int main()
{
double vehicle_price, options_price, new_result, end_solution, sales_tax_region, v8_price, sales_tax;
double region_0, region_1, region_2;
// This where the sales person will ask the customer if a v8 is desired.
cout << "vehicle_price:$" ;
cin >> vehicle_price ;
cout << "options_price:$" ;
cin >> options_price ;
// At this time the customer would be asked which region they live in.
// enter 6.5 or 7.0 to indicate if region_1 or region_2 is where they live
cout << "v8_price:$" ;
cin >> v8_price ;
cout << "sales_tax_region:" ;
cin >> sales_tax_region ;
// At this point the price of the v8 would be entered if it is required.
if (region_1 <= 500.00)
{
sales_tax= region_1 *.65;
}
if (region_2 <= 550.0)
{
sales_tax_region= region_2 * .70;
}
else
{
if (region_0 <= 0.0);
}
sales_tax_region= region_1 * .65;
{
}
new_result= (options_price + vehicle_price+ v8_price)*(sales_tax_region/100) ;
end_solution = (new_result + options_price + vehicle_price);
cout << "Total_price_of_the_vehicle:$" << end_solution << endl ;
return 0;
}
这是我使用的要求,使用"if-else"结构来确定使用哪个V8价格。使用另一个" if-else "结构来根据地区代码确定要选择的销售税值。
我完全迷失在"if" "else"部分。
变化
else
{
if (region_0 <= 0.0);
}
sales_tax_region= region_1 * .65;
{
}
else
if (region_0 <= 0.0) {
sales_tax_region= region_1 * .65;
}
相关文章:
- 为什么我的最后一个 ELSE 条件无法正确执行
- 当我的 if 条件计算结果为 false 时,我的 else 块将不会执行
- 我怎样才能接受输入作为双精度值并执行 IF ELSE 语句
- c++ IF 语句执行,但添加 ELSE 会显示错误
- C++ 如果 Else 两个语句都在不应该执行的时候执行
- MQL4:我的if/else if liop只有一半导致当前执行
- 主要使用 if 和 else 语句的程序未正确执行
- 如何使用我的 if-else 语句根据用户权重的输入执行特定操作,然后将其显示到控制台?
- 如果和 else 部分都在执行
- 同时执行 if 和 else 条件的逻辑是什么
- 为什么我的else条件从未执行
- 为什么我的If/Else语句块没有完全执行
- 可执行文件C++问题:while 循环和 if/else if/else
- C++if-else语句继续执行if,而不是else下的代码
- If语句和else If语句将执行
- If else语句将不会执行
- 嵌套的if-else语句只执行一个条件(c++)
- if/ Else的Else组件不执行(c++)
- 执行else块和if块之后的代码
- If和Else条件都执行c++