Skip to main content
agena martin ha fatto una domanda in #Integration

I'm new to C# we have an activity to create a lottery game.

1 matching number won $10 2 matching number won $100 3 matching number not in order $1,000 3 matching number in order won $10,000

I'm having issues with my code even there are 2 matching or 3 matching number it always display $10. Any help would be appreciated.

Below are the source code.

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

namespace LotteryGame

{

class Program

{

static void Main(string[] args)

{

// Matching numbers awards

int rNumMatchOne = 10;

int rNumMatchTwo = 100;

int rNumMatchThree = 1000;

int rNumMatchFour = 10000;

// Generate random numbers

Random randomNum = new Random();

// Integers Declaration

int rNum1;

int rNum2;

int rNum3;

int rNumIput;

int guessNum;

// Arrays Declartion

int[] guessNumMatch = new int[3];

1 risposta
  1. 25 ott 2023, 12:29

    Hey @agena martin,

    You should ask your question in Microsoft communities (or stackoverflow) since your programming language is CSharp not Salesforce Apex. Also your source code is not full.

0/9000