What's new

Closed C# winforms

Status
Not open for further replies.

anonymous_d

Honorary Poster
Joined
Oct 5, 2016
Posts
270
Reaction
36
Points
142
Age
27
pano po kaya yung ibabase ko yung quantity yung price na bibilin nila for example po 3 bibilin tapos fix na rin po yung price nila halimbawa po 100 so kung 3 ang bibili di bale 300 po pano po yung ganun badly needed po salamat po sa tutulong
 

Attachments

gamit ka calcu jan sa loob ng form pero kung ayaw mo naman, try mo if else HAHA
{
If Quantity ="1" then
Price.text = "100"
elseif Quantity "2" then
Price.text = "200"
Endif
}
Just an example but ikaw na bahala kung ano gusto mo
Correct me if im wrong kinda kawang nako sa coding kasi nagstop na ko matagal na sa coding eh.
Madami ka pwede magamit jan like gawa ka mismo ng calcu button or if else statement.
 
Last edited:
Syempre kailangan mo yung value ng quantity ng item saka its price.
Multiply then show it sa UI.
 
I assume na yung items mo eh naka class or object siya na may price. So kunin mo lang yun then multiply mo sa quantity na kukunin mo sa textbox then ilagay mo sa text for price.
 
gamit ka calcu jan sa loob ng form pero kung ayaw mo naman, try mo if else HAHA
{
If Quantity ="1" then
Price.text = "100"
elseif Quantity "2" then
Price.text = "200"
Endif
}
Just an example but ikaw na bahala kung ano gusto mo
Correct me if im wrong kinda kawang nako sa coding kasi nagstop na ko matagal na sa coding eh.
Madami ka pwede magamit jan like gawa ka mismo ng calcu button or if else statement.

pano pag aabot ng 1mil ang quantity? edi ang haba nun? HAHAHAHA
 
pano pag aabot ng 1mil ang quantity? edi ang haba nun? HAHAHAHA
pag ganun naman, syempre hindi mo na need ng if else lol, calcu na gamitin mo. yung point ko lang naman jan sa code ko is kung hindi mo alam pano gumawa ng calcu form mag if else ka na lang. madami naman tutorial sa YøùTùbé pero kung ayaw if else lang talaga ahahahaha tiisan
 
Code:
using System;

class MainClass {
  public static void Main (string[] args) {
    Console.WriteLine ("Hello World");

    // const means constant
    const double pricePerItem = 100.50;

    // assume we are reading from a text input
    string quantity = "3";

    double finalPrice = int.Parse(quantity) * pricePerItem;

    Console.WriteLine(finalPrice);
    // prints 301.5

  }
}
 
Status
Not open for further replies.

Similar threads

Back
Top