Use of strings 3 - var2

  • docx
  • 02.05.2020
Публикация на сайте для учителей

Публикация педагогических разработок

Бесплатное участие. Свидетельство автора сразу.
Мгновенные 10 документов в портфолио.

Иконка файла материала Use of strings 3 - var2.docx

Long term plan unit:

School:

Data:

Teacher’s name:

Class:

The number of attendees:

absentees:

Lesson theme

Use of strings

Learning objectives that are achieved in this lesson (Subject Programme ref)

Use of procedures and functions for processing strings

Lesson objectives

Use of procedures and functions for processing strings

Evaluation criteria

Knowledge

·     Know how to display Date in a string

 

Understanding

·     Describes Dynamic Strings In C#

 

Application

·     Write code for processing the strings using functions

·     Write code for processing the strings using procedures

 

Analysis

·     Analyzes given program to complete it

 

 

 

Language objectives

 

Student is able to describe that memory, which is allocated for the string, cannot change. So, strings are immutable.

For instance, while concatenating strings the old string exists in memory until garbage collection occur, that’s resource consuming.

Thus, student has to work out (conclude) the implementation of StringBuilder  Class and its methods.

Also, student can justify the purpose of function or procedure used for processing string.

Vocabulary and terminology specific to the subject:

string, string operators, comparing stings, substring, append, index , length of the substring, StringBuilder  Class, date

Useful expressions for dialogs and letters:

Well, to work with dynamic strings … .

For example, AppendFormat method specifies a format for the … .

As a matter of fact, the stings are used in the wide variety of cases to  … .

 

Cultivating values

 

 

collaboration, mutual respect, academic honesty, perseverance, responsibility, lifelong learning

Cross curricular links

English, Math

Prior knowledge

 

strings

During the classes

Planned stages of the lesson

Planned activities in the classroom

Resources

Beginning

4 min

 

 

1.      Greetings

2.      Starter

(C) questions for revision of previous content.

    3. Announcement of topic and LO

   Students asked to think about Evaluation Criteria(EC) for LO to work it out (official EC is supplied)

3.      Vocabulary

4.      Useful expressions for dialogs

 

 

 

Slides 1-4

Middle

 

   

5 min

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

7 min

 

3 min

 

 

 

15 min

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

4 min

Task 1

Action: practice

Purpose: to analyze and complete the program

Description:

Teacher’s activities:

Student’s activities:

Explains the   task and spreads the handout with code.

 

After task completed shows on slide the answer

(P) in pairs, students deduce the points of missed code both in main program and procedure

 

Checks themselves

 

Evaluation:

Evaluation Criteria

Descriptors

Analyzes given program to complete it

·         Deduces from program its output

Write code for processing the strings using procedures

·         Calls the procedure

 

 

Feedback: Teacher makes comments or correction when necessary

 

Theory

Rebus is presented for guessing the word StringBuilder

Teacher presents StringBuilder class. Provides a code example.

Students write down the core information.

 

Consolidating video “String vs StringBuider”

 

Task 2

Action: practice

Purpose: to practice the StringBuilder methods

Description:

Teacher’s activities:

Student’s activities:

Explains the   task and spreads the handout with code snippets.

 

 

(I) students types and execute the given snippets of StringBuilder methods to practice them.

 

Afterwards, in pairs explains each other different methods (each student talks about 2 method, other student talks about 2 different methods)

 

 

Evaluation:

Evaluation Criteria

Descriptors

Describes Dynamic Strings In C#

·         After typing and executing, explains purpose and use of 2 (two) of the  following methods of StringBuilder class:

  1. Append
  2. AppendFormat
  3. Insert
  4. Remove
  5. Replace

 

Differentiation:  The students who finish earlier researches the StringBuilder.Capacity Property to understand how the memory allocated for by StringBuilder.

Feedback: Teacher makes comments or correction when necessary

 

Summary

Questions:

How do you understand the phrase: ‘strings are immutable’?

What happens if the string has changed?

Explain the principle of memory allocation by StringBuilder class (how the memory  is allocated by StringBuilder in case when string has changed)

 

 

Handout 1

Slides 5-6

Appendix 1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Slides 7-12

 

Slide 13

 

 

 

 

Slide 15

Handout 2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Slide 16

 

 

 

End

2 min

Learners reflect at the end of the lesson:

Where is I am? (Blob tree)

Slide 17

Differentiation - how do you plan to provide more support? What tasks do you plan to put before more able learners?

Evaluation - how do you plan to check the level of mastering the material by learners?

Health and safety practices


Дифференциация может быть выражена в подборе заданий, в ожидаемом результате от конкретного ученика, в оказании индивидуальной поддержки учащемуся, в подборе учебного материала и ресурсов с учетом индивидуальных способностей учащихся (Теория множественного интеллекта по Гарднеру).

Дифференциация может быть использована на любом этапе урока с учетом рационального использования времени.

Use this section to record the methods that you will use to assess what students have learned during the lesson.

Health-saving technologies.

Used body and physical exercises.

Points applied from the Safety Rules in this lesson.

Reflection on the lesson

 

Were the goals of lesson/ learning objectives realistic?

Have all the students reached the LO?

If not, why?

Is the differentiation done correctly in the lesson?

Were the time stages of the lesson sustained?

What were the deviations from the lesson plan and why?

Use this section to reflect on the lesson. Answer the most important questions about your lesson from the left column.

 

Overall assessment

 

 

What two aspects of the lesson went well (think about both teaching and learning)?

1:

 

2:

 

What could help improve the lesson (think about both teaching and learning)?

1:

 

2:

 

What I found during the lesson related to the class or the achievements / difficulties of individual students, what should I look for in subsequent lessons?

 

 

 

 

Appendix 1

 (handout 1)

Task 1. Complete the code

 

static void  TellDate(DateTime dt)

            {           

            string strDate = dt.ToString("M");

            Console.WriteLine("Date and Time  :  {0}", __________);

            Console.WriteLine("Month and Date :  {0}", __________);                  

           }

       

       static void Main(string[] args)

        {           

            DateTime date = new DateTime(2019, 6, 23);

            _________________________________________

            Console.ReadLine();

        }

 

Task 2

Handout 2

Examples of Each method

Let us create an object, as shown below.

1.   StringBuilder sb= new StringBuilder(“ABCD”);  

APPEND

  1. Way of Appending
    s.Append(“EF”);

  2. Output
    ABCDEF

APPEND FORMAT

  1. Way to apply appendformat
    s.AppendFormat (“{0:n}”,1100);

  2. Output
    ABCDEF1,100.00

INSERT

  1. Way to insert an object
    s.Insert(2,”Z”);

  2. Output
    ABZCDEF1,100.00

REMOVE

  1. Way to Remove the object
    s.Remove(7,6);

  2. Output
    ABZCDEF00

REPLACE

  1. Way to Replace an object
    s.Replace(“0”,”x”);

  2. Output
    ABZCDEFXX

 

Links:

1.      https://docs.microsoft.com/en-us/dotnet/api/system.text.stringbuilder.capacity?view=netframework-4.7.2

 

2.      https://www.c-sharpcorner.com/article/how-to-create-dynamic-strings-in-c-sharp/

 

 


 

Скачано с www.znanio.ru