An application contains the following Structure statement: Structure MyFriend Pu
ID: 670420 • Letter: A
Question
An application contains the following Structure statement:
Structure MyFriend
Public strLast As String
Public strFirst As String
End Structure
Write a C# declaration statement that declares a MyFriend variable named school.
Write an assignment statement that assigns the value in the txtFirst control to the strFirst member.
Write an assignment statement that assigns the value in the txtLast control to the strLast member.
Write an assignment statement that assigns the value in the strLast member to the lblLast control.
Write an assignment statement that assigns the value in the strFirst member to the lblFirst control.
Justify your answers using examples and reasoning. Comment on the postings of at least two classmates with regard to whether you agree or disagree with their views.
Explanation / Answer
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace stru
{
public partial class Form1 : Form
{
public struct MyFriend
{
public String strLast;
public String strFirst;
};
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void txtFirst_TextChanged(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
MyFriend school;
school.strFirst=txtFirst.Text ;
school.strLast=txtLast.Text ;
lblFirst.Text = school.strFirst;
lblLast.Text = school.strLast;
}
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.