using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; namespace Homework { public partial class frmMAIN : Form { // you can describe what your doing in code by making comments ie "//" // decalring a string variable ie text // at a global level so all events can see them // events happen when the user of the app does something string strMessage = "Did the dog really eat your homework?"; string strTitle = "The dog ate my homework!!!";
DialogResult dialogResult = new DialogResult();
public frmMAIN() { InitializeComponent(); } private void frmMAIN_Load(object sender, EventArgs e) { //forms are objects so are labels and buttons. //c# example windows forms .net //you can run code in form_load it will auto run //make the main object show this //the main form in c# is this this.Show(); //Early way to make the app stop a minute by releasing the processor Application.DoEvents(); //declaring a integer variable a number int intDog_Encounter = 100; //you refer to the main form as this! //you can set the properties of this this.Text = strTitle; this.StartPosition = FormStartPosition.CenterScreen; //Create an object on this Label labConfess = new Label();
//Set where the object appears on the form labConfess.Location = new Point(0, 100); labConfess.AutoSize = true; labConfess.Text = strMessage; //Add thw object to the form this.Controls.Add(labConfess); //Create an object on this Button btnConfess = new Button(); //Set where the object appears on the form btnConfess.Location = new Point((this.Bounds.Width - 100), (this.Bounds.Height - 100)); btnConfess.AutoSize = true; btnConfess.Text = "Confess!"; //Add thw object to the form this.Controls.Add(btnConfess); //example of an algorithm counting down do { //increment an integer variable intDog_Encounter--; //labConfess labConfess.Text = "You have " + intDog_Encounter.ToString() + " seconds to confess!"; //advanced way to slow an apps code from running for a second. //milisecond = one second ie 1000 = 1 second //every app is running in its own thread Thread.Sleep(1000); //some apps run additional threads //Early way to make the app stop a minute by releasing the processor Application.DoEvents(); } while (intDog_Encounter != 0); Application.Exit(); } private void frmMAIN_FormClosing(object sender, FormClosingEventArgs e) { // This is also an algorithm but with conditional logic. //It will not let the app close till you confess! //you can reassign a global variable strTitle = "Really!!!"; do { //MessageBox example dialogResult = MessageBox.Show(strMessage, strTitle, MessageBoxButtons.YesNo); //conditonal logic until you confess the algorithm continues if (dialogResult == DialogResult.No) { Application.Exit(); } //Early way to make the app stop a minute Application.DoEvents(); } while (dialogResult != DialogResult.No); } } }
We're thrilled to have been a part of your learning experience, and we hope that you feel confident and prepared to take on new challenges in your field. If you're interested in further expanding your knowledge, check out our course offerings in the description box.
We are glad you found our video helpful. Like and share our video with your peers and also do not forget to subscribe to our channel for not missing video updates. We will be coming up with more such videos. Cheers!
We are beyond grateful for your warm congratulations on our channel reaching 3 million subscribers. It means a lot to us to know that we have been able to provide valuable content that has helped you on your learning journey. Thank you for choosing us as your learning partner and for your continued support. We are thrilled to hear that you enjoyed your experience with us! If you are looking to expand your knowledge further, we invite you to explore our other courses in the description box.
WooHoo! We are so happy you love our videos. Please do keep checking back in. We put up new videos every day on all your favorite topics Have a good day!
A friend(we started a club) told me over this holiday to create an algorithm(both of us) . I'm confused whether Im supposed to create a program or... . Plz help
🔥Full Stack Java Developer Program (Discount Code - YTBE15) - www.simplilearn.com/java-full-stack-developer-certification?LSGGV-1k&Comments&RUclips
🔥Full Stack Developer - MERN Stack Program (Discount Code - YTBE15) - www.simplilearn.com/full-stack-developer-course-mern-certification-training?LSGGV-1k&Comments&RUclips
🔥Caltech Coding Bootcamp (US Only) - www.simplilearn.com/coding-bootcamp?LSGGV-1k&Comments&RUclips
Got a Question on this topic? Let us know in the comment section below 👇 and we'll have our experts answer it for you. Thanks!
Splendid way to express the all topic such a nice explanation as well!
Thanks a lot 😊
Thanks for this video! Helped in class
Glad it helped!
super sir your expalnination Super and VOICE soooo peacfull and soo good
Thank you so much 🙂
Algorithm is a simple reoccuring loop basically...
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Homework
{
public partial class frmMAIN : Form
{
// you can describe what your doing in code by making comments ie "//"
// decalring a string variable ie text
// at a global level so all events can see them
// events happen when the user of the app does something
string strMessage = "Did the dog really eat your homework?";
string strTitle = "The dog ate my homework!!!";
DialogResult dialogResult = new DialogResult();
public frmMAIN()
{
InitializeComponent();
}
private void frmMAIN_Load(object sender, EventArgs e)
{
//forms are objects so are labels and buttons.
//c# example windows forms .net
//you can run code in form_load it will auto run
//make the main object show this
//the main form in c# is this
this.Show();
//Early way to make the app stop a minute by releasing the processor
Application.DoEvents();
//declaring a integer variable a number
int intDog_Encounter = 100;
//you refer to the main form as this!
//you can set the properties of this
this.Text = strTitle;
this.StartPosition = FormStartPosition.CenterScreen;
//Create an object on this
Label labConfess = new Label();
//Set where the object appears on the form
labConfess.Location = new Point(0, 100);
labConfess.AutoSize = true;
labConfess.Text = strMessage;
//Add thw object to the form
this.Controls.Add(labConfess);
//Create an object on this
Button btnConfess = new Button();
//Set where the object appears on the form
btnConfess.Location = new Point((this.Bounds.Width - 100), (this.Bounds.Height - 100));
btnConfess.AutoSize = true;
btnConfess.Text = "Confess!";
//Add thw object to the form
this.Controls.Add(btnConfess);
//example of an algorithm counting down
do
{
//increment an integer variable
intDog_Encounter--;
//labConfess
labConfess.Text = "You have " + intDog_Encounter.ToString() + " seconds to confess!";
//advanced way to slow an apps code from running for a second.
//milisecond = one second ie 1000 = 1 second
//every app is running in its own thread
Thread.Sleep(1000);
//some apps run additional threads
//Early way to make the app stop a minute by releasing the processor
Application.DoEvents();
} while (intDog_Encounter != 0);
Application.Exit();
}
private void frmMAIN_FormClosing(object sender, FormClosingEventArgs e)
{
// This is also an algorithm but with conditional logic.
//It will not let the app close till you confess!
//you can reassign a global variable
strTitle = "Really!!!";
do
{
//MessageBox example
dialogResult = MessageBox.Show(strMessage, strTitle, MessageBoxButtons.YesNo);
//conditonal logic until you confess the algorithm continues
if (dialogResult == DialogResult.No)
{
Application.Exit();
}
//Early way to make the app stop a minute
Application.DoEvents();
} while (dialogResult != DialogResult.No);
}
}
}
Excellent presentation keep on doing the good work
Thank you for this video.🙏🏻
We're thrilled to have been a part of your learning experience, and we hope that you feel confident and prepared to take on new challenges in your field. If you're interested in further expanding your knowledge, check out our course offerings in the description box.
Could you please share vidio on all types of Algorithms in ML?
Thank you for this video.🙏🏻
We are glad you found our video helpful. Like and share our video with your peers and also do not forget to subscribe to our channel for not missing video updates. We will be coming up with more such videos. Cheers!
Thanks for sharing 🤗
Congratulations for 3 million subscribers
We are beyond grateful for your warm congratulations on our channel reaching 3 million subscribers. It means a lot to us to know that we have been able to provide valuable content that has helped you on your learning journey. Thank you for choosing us as your learning partner and for your continued support. We are thrilled to hear that you enjoyed your experience with us! If you are looking to expand your knowledge further, we invite you to explore our other courses in the description box.
Thank u for such a nice explanation.
Happy to help
cool video)
WooHoo! We are so happy you love our videos. Please do keep checking back in. We put up new videos every day on all your favorite topics Have a good day!
A friend(we started a club) told me over this holiday to create an algorithm(both of us) . I'm confused whether Im supposed to create a program or... . Plz help
Thanks buddy
We are so happy you love our videos. Please do keep checking back in. We put up new videos every day on all your favourite topics Have a good day!
👍👍👍👍
Keep learning with us .Stay connected with our channel and team :) . Do subscribe the channel for more updates : )
👍
Keep learning with us .Stay connected with our channel and team :) . Do subscribe the channel for more updates : )
Thank u for such a nice explanation.
You are most welcome