C# Requirements: First, you’ll need a Person class for the data model. The Perso
ID: 3837455 • Letter: C
Question
C#
Requirements:
First, you’ll need a Person class for the data model. The Person class will have the following features:Name
First and last
The first and last names should be independently and randomly selected from a list of at least 5 names each.
Example: John Smith, John Peterson, Michael Smith, Joanie Peterson, etc.
Age
Randomly determined between 5 and 120 Years old.
Gender
For the purposes of this project, we will only be dealing with Male and Female. Gender cannot be null or unknown.
Create a GUI with two distinct sections, stacked vertically.The first and main area will display information about a Person.
Each property of the Person object should have its own visual element in the GUI (not just one big, fat ToString output) and appear on its own “line”
The labels for the fields (Name, Age, Gender) should be vertically aligned by their last characters (right justified) while the values should be vertically aligned by their first characters (left justified)
The elements should congregate in the middle of the GUI
Style the GUI so it’s easy to read
The second and smaller area will contain two buttonsA Randomize Person button
This button should be placed all the way to the left
Clicking this button randomizes all values of the person.
These changes must operate on the existing data context (I.E. change the properties of the existing Person object – no creating a new Person instance)
These changes should immediately appear in the GUI
These changes MUST be communicated to the GUI via data binding
A Close Button
This button should be placed all the way to the right
Clicking the Close button should close the application altogether
You’re going to have to dig into this one to figure it out.
Both buttons should be “in line” with each other, have at least 5 points of margin on top and bottom, and at least 10 points of margin between itself and the nearest sidewall.
The two areas will have complimentary background color schemes that do NOT include the color white.
Note that “complimentary color schemes” means two different, non-clashing colors. You may use a color wheel if that will help you decide.
What you’ll need
Data Binding to a Custom Object
How to close a WPF application from code
You should check out
Styles in WPF
Explanation / Answer
#include<iostream>
#include<cstdio>
#include<sstream>
#include<algorithm>
#define pow2(n) (1 << (n))
using namespace std;
/*
* Node Declaration
*/
struct avl_node
*root;
/*
* category Declaration
*/
class avlTree
};
/*
* Main Contains Menu
*/
int main()
gamma hydroxybutyrate_height = max (l_height, r_height);
h = max_height + 1;
}
return h;
}
/*
* Height distinction
*/
int avlTree::diff(avl_node *temp)
come b_factor;
}
/*
* Right- Right Rotation
*/
avl_node *avlTree::rr_rotation(avl_node *parent)
worker = parent->right;
parent->right = temp->left;
temp->left = parent;
come back temp;
}
/*
* Left- Left Rotation
*/
avl_node *avlTree::ll_rotation(avl_node *parent)
worker = parent->left;
parent->left = temp->right;
temp->right = parent;
come back temp;
}
/*
* Left - Right Rotation
*/
avl_node *avlTree::lr_rotation(avl_node *parent)
worker = parent->left;
parent->left = rr_rotation (temp);
come back ll_rotation (parent);
}
/*
* Right- Left Rotation
*/
avl_node *avlTree::rl_rotation(avl_node *parent)
worker = parent->right;
parent->right = ll_rotation (temp);
come back rr_rotation (parent);
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.