private static void writeOutputTxt(string[,] student, double[] studentAvg, string[] studentLetterGrade) { string path = @"output.txt"; // We specify the path of the file that we will read. FileStream fs = new FileStream(path, FileMode.OpenOrCreate, FileAccess.Write); // Created a file stream object. StreamWriter sw = new StreamWriter(fs); // Created a StreamWriter object for reading. // Results will be printed to file and console. for (int i = 0; i < numberOfStudents; i++) // Will return as many as the number of students { sw.WriteLine(student[i, 0] + " " + student[i, 1] + " " + student[i, 2] + " - Student Average: " + studentAvg[i] + " - Letter Grade: " + studentLetterGrade[i]); Console.WriteLine(student[i, 0] + " " + student[i, 1] + " " + student[i, 2] + " - Student Average: " + studentAvg[i] + " - Letter Grade: " + studentLetterGrade[i]); } sw.WriteLine("\n- LETTER GRADE STATUS OF THE CLASS -"); sw.WriteLine("AA: " + AA.ToString() + " Person - " + Convert.ToInt32((AA * 100) / numberOfStudents) + "% OF THE CLASS"); sw.WriteLine("BA: " + BA.ToString() + " Person - " + Convert.ToInt32((BA * 100) / numberOfStudents) + "% OF THE CLASS"); sw.WriteLine("BB: " + BB.ToString() + " Person - " + Convert.ToInt32((BB * 100) / numberOfStudents) + "% OF THE CLASS"); sw.WriteLine("CB: " + CB.ToString() + " Person - " + Convert.ToInt32((CB * 100) / numberOfStudents) + "% OF THE CLASS"); sw.WriteLine("CC: " + CC.ToString() + " Person - " + Convert.ToInt32((CC * 100) / numberOfStudents) + "% OF THE CLASS"); sw.WriteLine("DC: " + DC.ToString() + " Person - " + Convert.ToInt32((DC * 100) / numberOfStudents) + "% OF THE CLASS"); sw.WriteLine("DD: " + DD.ToString() + " Person - " + Convert.ToInt32((DD * 100) / numberOfStudents) + "% OF THE CLASS"); sw.WriteLine("FD: " + FD.ToString() + " Person - " + Convert.ToInt32((FD * 100) / numberOfStudents) + "% OF THE CLASS"); sw.WriteLine("FF: " + FF.ToString() + " Person - " + Convert.ToInt32((FF * 100) / numberOfStudents) + "% OF THE CLASS"); Console.WriteLine("\n- LETTER GRADE STATUS OF THE CLASS -"); Console.WriteLine("AA: " + AA.ToString() + " Person - " + Convert.ToInt32((AA * 100) / numberOfStudents) + "% OF THE CLASS"); Console.WriteLine("BA: " + BA.ToString() + " Person - " + Convert.ToInt32((BA * 100) / numberOfStudents) + "% OF THE CLASS"); Console.WriteLine("BB: " + BB.ToString() + " Person - " + Convert.ToInt32((BB * 100) / numberOfStudents) + "% OF THE CLASS"); Console.WriteLine("CB: " + CB.ToString() + " Person - " + Convert.ToInt32((CB * 100) / numberOfStudents) + "% OF THE CLASS"); Console.WriteLine("CC: " + CC.ToString() + " Person - " + Convert.ToInt32((CC * 100) / numberOfStudents) + "% OF THE CLASS"); Console.WriteLine("DC: " + DC.ToString() + " Person - " + Convert.ToInt32((DC * 100) / numberOfStudents) + "% OF THE CLASS"); Console.WriteLine("DD: " + DD.ToString() + " Person - " + Convert.ToInt32((DD * 100) / numberOfStudents) + "% OF THE CLASS"); Console.WriteLine("FD: " + FD.ToString() + " Person - " + Convert.ToInt32((FD * 100) / numberOfStudents) + "% OF THE CLASS"); Console.WriteLine("FF: " + FF.ToString() + " Person - " + Convert.ToInt32((FF * 100) / numberOfStudents) + "% OF THE CLASS"); sw.Flush(); // txt created sw.Close(); // Close file fs.Close(); }
public static bool GetButtonDown(CB button) { return(Input.GetButtonDown(button.ToString())); }
public void Show(Canvas p, Thickness m) { if (can != null) { can.Visibility = Visibility.Visible; can.Margin = m; return; } can = new Canvas(); can.Background = new SolidColorBrush(Colors.White); can.Margin = m; can.Width = 310; can.Height = 420; p.Children.Add(can); CreateMod(can); CreateModA(can); SA = new Slider(); SA.Foreground = new SolidColorBrush(Colors.Black); SA.Height = 20; SA.Width = 256; SA.Maximum = 255; SA.Value = 255; SA.ValueChanged += (o, e) => { CA = (byte)SA.Value; TA.Text = "A:" + CA.ToString(); bor.Background = new SolidColorBrush(Color.FromArgb(CA, CR, CG, CB)); }; SR = new Slider(); SR.Foreground = new SolidColorBrush(Colors.Red); SR.Height = 20; SR.Width = 256; SR.Maximum = 255; SR.Value = 255; SR.ValueChanged += (o, e) => { CR = (byte)SR.Value; TR.Text = "R:" + CR.ToString(); bor.Background = new SolidColorBrush(Color.FromArgb(CA, CR, CG, CB)); }; SG = new Slider(); SG.Foreground = new SolidColorBrush(Color.FromArgb(255, 0, 255, 0)); SG.Height = 20; SG.Width = 256; SG.Maximum = 255; SG.ValueChanged += (o, e) => { CG = (byte)SG.Value; TG.Text = "G:" + CG.ToString(); bor.Background = new SolidColorBrush(Color.FromArgb(CA, CR, CG, CB)); }; SB = new Slider(); SB.Foreground = new SolidColorBrush(Colors.Blue); SB.Height = 20; SB.Width = 256; SB.Maximum = 255; SB.ValueChanged += (o, e) => { CB = (byte)SB.Value; TB.Text = "B:" + CB.ToString(); bor.Background = new SolidColorBrush(Color.FromArgb(CA, CR, CG, CB)); }; can.Children.Add(SA); can.Children.Add(SR); can.Children.Add(SG); can.Children.Add(SB); TA = new TextBlock(); TA.Text = "A:255"; TR = new TextBlock(); TR.Text = "R:255"; TR.Foreground = new SolidColorBrush(Color.FromArgb(255, 255, 0, 0)); TG = new TextBlock(); TG.Text = "G:0"; TG.Foreground = new SolidColorBrush(Color.FromArgb(255, 0, 255, 0)); TB = new TextBlock(); TB.Text = "B:0"; TB.Foreground = new SolidColorBrush(Color.FromArgb(255, 0, 0, 255)); can.Children.Add(TA); can.Children.Add(TR); can.Children.Add(TG); can.Children.Add(TB); bor = new Border(); bor.Width = 48; bor.Height = 48; bor.Background = new SolidColorBrush(Color.FromArgb(255, 255, 0, 0)); can.Children.Add(bor); CA = 255; CR = 255; CG = 0; CB = 0; cancel = new Button(); cancel.Content = cancel_s[Component.language]; cancel.Click += (o, e) => { can.Visibility = Visibility.Collapsed; }; can.Children.Add(cancel); ok = new Button(); ok.Content = ok_s[Component.language]; ok.Click += (o, e) => { if (Seletced != null) { Seletced(Color.FromArgb(CA, CR, CG, CB)); } can.Visibility = Visibility.Collapsed; }; can.Children.Add(ok); Order(); }
public static bool GetButtonUp(CB button) { return(Input.GetKeyUp(GetKeyCode(button.ToString()))); }
public static string DisplayShortButtonName(CB button) { return(DisplayShortButtonName(button.ToString())); }