C + + window Junior Practice Project 1 function solving

Source: Internet
Author: User

1. Use the if statement to write the selection structure of the program, complete the following sub-function evaluation

  

(Hint: x 1 (1) , x 1 (2) is constant, variable names can be set to X1 and the X2 . )

The Windows version of the program can be as follows (two constant values can also be adjusted):

This is my final running interface:

This is the main code for solving and inserting graphics:

<span style= "FONT-SIZE:24PX;" >void Cmy2dlg::onbutton1 () {//Todo:add your control notification handler code hereupdatedata (); if (m_x<m_x1) m_f=0 ; else if (m_x<=m_x2) m_f= (m_x-m_x1)/(m_x2-m_x1); elsem_f=1; UpdateData (FALSE);} </span>


The following is the association of controls and variables:

Learning experience:

UpdateData ();//used to pass the data displayed by the control to the member variable

UpdateData (FALSE);//used to pass calculated data to the control.

C + + window Junior Practice Project 1 function solving

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.