[Solved] C# 2D arrays calendar day in the month

[ad_1] using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace calenderMonth1 { class Program { int[][] months; int day; static void Main(string[] args) { Program calendar = new Program(); calendar.Months(); calendar.ColRow(); calender.DisplayMonth(); } public void Display(int itr) { for (int i = 0; i < itr; i ++) { Console.WriteLine(); } } public … Read more

[Solved] What do the values in a function do in C?

[ad_1] Technically, the arguments to functions are expressions. Expressions come in many different forms. They can be variables, like in value = fun_1(num1, num2); or they can be constants, like in value = fun_1(1, 12); or even involve operators with other expressions: value = fun_1(fun_1(42, 1) * 3, sizeof “foo”); Note that the expressions must … Read more

[Solved] Sum and get the average of the values in the array

[ad_1] Answer of your Question #include <stdio.h> int main() { int array[10]; int num, negative_sum = 0, positive_sum = 0,j; static int i=0; float total = 0.0, average; label: j=i; printf (“Enter the value of N \n”); scanf(“%d”, &num); printf(“Enter %d numbers (negative, positve and zero) \n”, num); for (i; i < (j+num); i++) { … Read more

[Solved] What’s wrong with this program in C++?

[ad_1] This should do the work. #include <iostream> using namespace std; void chap(char,int,int); int main() { int x,z,q; char y; cout<<“do you want run program?”; cin>>x; while(x!=0) { cout<<“enter your character: \n”; cin>>y; cout<<“\nenter the number of lines: \n”; cin>>z; cout<<“enter 1 for normal pattern and enter 0 for unnormal pattern : \n”; cin>>q; chap(y,z,q); … Read more

[Solved] How to Calculate a Discount In LINQ [closed]

[ad_1] Firstly this code is really starting to need a ViewModel or some other construct that would enable you to decouple your business logic from your UI. Having said that, the quick and dirty answer to get you going, would be to implement an interim linq query and then build your results from that // … Read more

[Solved] My program is crahing, and honestly i am confused (c++)

[ad_1] Not likely to be your crash, but this code is terrible: if (fnameFile.is_open()) { while (fnameFile.eof() == false) { plFname.resize(numFnames); getline(fnameFile,line); numFnames += 1; } fnameFile.close(); } It doesn’t check for end of file correctly, because end of file happens during getline, not before. And the line variable goes nowhere. Try while (getline(fnameFile,line)) plFnames.push_back(line); … Read more

[Solved] Make Exceptions work [closed]

[ad_1] There are some flaws in your code: you should prefer int.TryParse instead of Parse. An Exception should be an unexpected behavior, where you have to react in some way. A userinput is not unexpected, you know there’s a chance that the use inputs invalid data which you can/have to validate. When you use exceptions, … Read more

[Solved] How to Map my input data [closed]

[ad_1] Code string str = “VALVE,GATE,SH_NAME:VLV,GATE,VLV_NOM_SIZE:4-1/16IN”; string[] Rows = str.Split(‘,’); dataGridView1.Columns.Add(“Column1”, “Column1”); dataGridView1.Columns.Add(“Column2”, “Column2”); foreach (string AddRow in Rows) { string[] Row = AddRow.Split(‘:’); dataGridView1.Rows.Add(Row); } 2 [ad_2] solved How to Map my input data [closed]