我正在制作“假”假期计划指南 它要求用户选择一个地点,然后选择他们想要做的活动 我似乎无法使其在这种情况下将像199.99这样的小数总计加到全局总计 我在这里做什么错了?
//顺便说一下,这一切都在公共主类中
struct rte_eth_dev_info dev_info;
const struct rte_pci_device *pci_dev;
rte_eth_dev_info_get(port, &dev_info);
pci_dev = RTE_DEV_TO_PCI(dev_info.device);
memcmp((const void *)&pci_dev->addr,(const void *)&Input[iLoop].guestpci,sizeof(pcii
_dev->addr))==0) && (rte_memcmp((const void *)&gBtgData.nic_port[port].mac_addr,(const void *)&Input[iLoop]..
mac_addr,sizeof(gBtgData.nic_port[port].mac_addr))==0)
答案 0 :(得分:0)
只需将您的价格套餐绑定到Total
。
double Total = 0.00;
string destination = Console.ReadLine();
int Destination = Convert.ToInt16(destination);
switch (Destination)
{
case 1:
{
Console.WriteLine("you have selected Barbados! Heres the following excursions you can do!");
Console.WriteLine("_________________________!Excursions!_________________________________");
Console.WriteLine(" ");
Console.WriteLine("Snorkeling in Barbados bay: $199.99 Per Person");
Console.WriteLine("Press 1");
Console.WriteLine("Barbados Tour Bus Adventure: $59.99 Per Person");
Console.WriteLine("Press 2");
Console.WriteLine("Barbados Shopping Extravanga: $199.99 Per Person");
Console.WriteLine("Press 3");
Console.WriteLine("_________________________!Excursions!_________________________________");
Console.WriteLine(" ");
Console.WriteLine("What is your choice?");
string barbadosanswer = Console.ReadLine();
int barbadosAnswer = Convert.ToInt32(barbadosanswer);
switch(barbadosAnswer)
{
case 1:
Total += 199.99;
Console.WriteLine("You have selected Snorkeling in Barbados bay! Your total is currently " + Total);
break;
}