What's new

# HelpC# Error while in putting "else"

#### G I N E B R A

##### Forum Guru
Guys bakit kaya nag eerror to? Kanina kopa hindi makuha kuha.

#### Benzoii

Elite
patingin ng syntax lods hehe

#### WatchMefall

Established
check mo yung mga braces mo and colons

#### inusena

Elite
baka po may mali sa code hehe

#### G I N E B R A

##### Forum Guru
Paps. Iba nato baka alam nyo
patingin ng syntax lods hehe
check mo yung mga braces mo and colons
baka po may mali sa code hehe
PT 2
Directions: Design algorithm ang flow chart that displays the product of two number using Repeated addition.
Algorithm
Step 1 - Start
Step 2 – int A = 0, B = 0, C= 0

C# Language po kami.

#### inusena

Elite
int num1=0, num2=0, count=0, product=0;
input num1;
input num2;
while (count < num2){
product = product + num1;
count++;
}
display product;

convert mo na lang po sa algorithm at flow chart haha

#### G I N E B R A

##### Forum Guru
int num1=0, num2=0, count=0, product=0;
input num1;
input num2;
while (count < num2){
product = product + num1;
count++;
}
display product;

convert mo na lang po sa algorithm at flow chart haha
Pa convert kuys. Aralin ko nlng. 1st year lang po kase ako e. Tas nung K12 humms pa kinuha ko. Kya wala po talaga ako background. Pa help po.

#### inusena

Elite
depende kasi yung algorithm at flowchart kung paano ang tinuro sa inyo

#### G I N E B R A

##### Forum Guru
[XX='inusena, c: 411141, m: 588361'][/XX] tama batong algorithm nag try lang ako kuys.

#### inusena

Elite
[XX='G I N E B R A, c: 411158, m: 1031988'][/XX] apat dapat yung variable mo
imagine mo muna kung paano tatakbo based sa question:

"displays the product of two number using Repeated addition"

so merong 2 numbers na input ng user
num1(A)
num2(B)

merong product
product(C)

gamit daw ng repeated addition kaya kailangan mo bilangin kung nakailang add na ba
counter(D)

----
Sample:
input num1: 10
input num2: 5
(product alam natin na 10 x 5 = 50)
pero ang gagawin ng program:

product = 0;
count = 0;

product = product + 10; // 10
count = count + 1; // 1
(count == num2) false ;

product = product + 10; // 20
count = count + 1; // 2
(count == num2) false ;

product = product + 10; // 30
count = count + 1; // 3
(count == num2) false ;

product = product + 10; // 40
count = count + 1; // 4
(count == num2) false ;

product = product + 10; // 50
count = count + 1; // 5,
(count == num2) true ; // stop na

display output
product = 50

#### inusena

Elite
dapat kahit ano ang input ng user, tama pa din ang sagot pag dumaan sa code mo

#### G I N E B R A

##### Forum Guru
[XX='inusena, c: 411222, m: 588361'][/XX] nakakalito paps. Pedeng pasagot nung problem ko? Kahiya hiya man po. Nakakalito. Wala naman pong masearch.

#### inusena

Elite
[XX='G I N E B R A, c: 411283, m: 1031988'][/XX] paste mo dito yung nagawa mo

#### G I N E B R A

##### Forum Guru
[XX='inusena, c: 411292, m: 588361'][/XX]
Step 1 - Start
Step 2 – int A = 0, B = 0, C= 0
Step 3- Input num
Step 4- C = C + A;
Step 5- B = B +1
Step 6 - if B == 5
Output C
Else
Go to step 3
7.End

#### G I N E B R A

##### Forum Guru
Ayan po. Salamat po talaga.

#### inusena

Elite
Step 1 - Start
Step 2 - int A = 0, B = 0, C= 0, D = 0
Step 3 - Input A
Step 4 - Input B
Step 5 - if D < B
Step 5.1 - C = C + A
Step 5.2 - D = D + 1
Step 5.3 - Go to Step 5
Step 6 - Output C
Step 7 - End

#### G I N E B R A

##### Forum Guru
Step 1 - Start
Step 2 - int A = 0, B = 0, C= 0, D = 0
Step 3 - Input A
Step 4 - Input B
Step 5 - if D < B
Step 5.1 - C = C + A
Step 5.2 - D = D + 1
Step 5.3 - Go to Step 5
Step 6 - Output C
Step 7 - End
Salamat Paps pano din po kaya pag Flowchart ito?

#### inusena

Elite
depende din kung paano itinuro sa inyo

#### inusena

Elite
yan na din yun idadrawing mo lang

Replies
11
Views
369
Replies
11
Views
594
Replies
0
Views
376
Replies
31
Views
691
Replies
348
Views
11K

Members online
1,603
Guests online
1,230
Total visitors
2,833