编译代码时遇到几个错误

问题描述 投票:-2回答:1
#include <iostream>
#include <iomanip>
#include <string>>

using namespace std;

const double uData = 45;
const double mData = 25;
const double lData = 15;
const double militaryY = 0.10;
const double militaryN = 0.00;

int main ()

{ 

    double uData, mData, lData, subTotal, tAmount, fTotal, ssTotal, pLines;
    char dataType, miitaryY, militaryN


uData = U
mData = M
lData = L
pLines >=1

    if (militaryY)
    {
        ssTotal = (pLines + uData) * militaryY;
        subTotal = ssTotal + pLines + uData
        fTotal = (subTotal * tAmount) + subtotal
    }
    else if (militaryN)
    {
        subTotal = fTotal + pLines + uData
        fTotal = (subTotal * tAmount) + subtotal
    }
    else if (militaryY)
    {
        ssTotal = (pLines + mData) * militaryY;
        subTotal = ssTotal + pLines + mData
        fTotal = (subTotal * tAmount) + subtotal
    }
    else if (militaryN)
    {
        subTotal = fTotal + pLines + mData
        fTotal = (subTotal * tAmount) + subtotal
    }
        else if (militaryY)
    {
        ssTotal = (pLines + lData) * militaryY;
        subTotal = ssTotal + pLines + lData
        fTotal = (subTotal * tAmount) + subtotal
    }
    else if (militaryN)
    {
        subTotal = fTotal + pLines + lData
        fTotal = (subTotal * tAmount) + subtotal
    }

    cout << "How many phone lines are there(Max 3, **Cannot enter 0**) " << pLines << " ? " << endl;
    cout << "Are you active or retired military (Y or N) " << militaryY << militaryN << " ? " << endl;
    cout << "What type of data plan are you using (U, M, L) " << uData << mData << lData << " ? " << endl;
    cout << "Your subtotal is " << subTotal << " $ . " << endl;


        system("pause");
    return 0;
}

// 3 18 C:\ Users \ adamp \ Desktop \ DevCppFiles \ Project 4 \ Powers4.cpp [警告] #include指令末尾的额外令牌// C:\ Users \ adamp \ Desktop \ DevCppFiles \ Project 4 \ Powers4.cpp在函数'int main()'中:// 21 1 C:\ Users \ adamp \ Desktop \ DevCppFiles \ Project 4 \ Powers4.cpp [错误]预期的初始化程序在'uData'之前// 32 2 C:\ Users \ adamp \ Desktop \ DevCppFiles \ Project 4 \ Powers4.cpp [错误]'else',而没有前面的'if'// 35 3 C:\ Users \ adamp \ Desktop \ DevCppFiles \ Project 4 \ Powers4.cpp [错误]预期为';'在“ fTotal”之前// 41 3 C:\ Users \ adamp \ Desktop \ DevCppFiles \ Project 4 \ Powers4.cpp [错误]预期为';'在“ fTotal”之前// 46 3 C:\ Users \ adamp \ Desktop \ DevCppFiles \ Project 4 \ Powers4.cpp [错误]预期为';'在“ fTotal”之前// 52 3 C:\ Users \ adamp \ Desktop \ DevCppFiles \ Project 4 \ Powers4.cpp [错误]预期为';'在“ fTotal”之前// 57 3 C:\ Users \ adamp \ Desktop \ DevCppFiles \ Project 4 \ Powers4.cpp [错误]预期为';'在“ fTotal”之前

c++ compiler-errors runtime-error compiler-warnings
1个回答
0
投票

从标题中删除多余的>

© www.soinside.com 2019 - 2024. All rights reserved.