Saturday, March 18, 2017

Arrangements for upcoming National Book Fair enter final stage

The arrangements to organize the grand festival of National Book Fair in federal capital from April 22-24 have entered into final stages.
This was conveyed by the officials of National Book Foundation (NBF) during a meeting held here Wednesday to review arrangements of book fair.

Pakistan triples representation in list of Asia's best universities

LONDON: Pakistan has tripled its representation in the list of Asia’s best universities with seven Pakistani institutions in the top 300.


The Times Higher Education list for the latest Asia University Rankings 2017 shows that Pakistan has seven institutions in the top 300, five of which are new entrants.

In a first, Karachi's UIT students develop robotic legs model for the disabled

Three students of Usman Institute of Technology (UIT), Karachi have developed a model for wearable robotic legs, which will help disabled persons move and function on their own again.

“We have developed this exoskeleton model for paraplegics to assist them in the functions of sitting, standing and walking,” explained Moutasim Abbasi, who led the project. The other two students included Adil Hanif and Muhammad Usman.




The group, working under the supervision of Associate Professor Engineer Raza Jafri, exhibited their four months of hard work and research at the Pakistan Auto Parts Show (PAPS) held recently at Expo Centre, Karachi.

UET VC told to denotify appointments

LAHORE: The Higher Education Department (HED) has again directed the University Of Engineering and Technology vice chancellor to denotify the unlawful/irregular appointments of the registrar, deputy registrar and controller within the next seven days, rejecting its stance on the issue.

As a last effort, the UET administration through a letter No Univ/PS/Reg/21 of Jan 21 along with a report of the committee, had explained its point of view to prove that the appointments were made under the law. However, the explanation couldn’t satisfy the department.

HEC, French embassy celebrate cooperation

Islamabad-Higher Education Commission in collaboration with Embassy of France on Thursday celebrated ‘Pak-French Cooperation’ in higher education sector to strengthen the bilateral relations.

The Minister of State for Federal Education and Professional Training, Baligh-ur-Rehman, Dr Chairman HEC Mukhtar Ahmed, Ambassador of France to Pakistan Martine Dorance, attended the ceremony.

100 model schools to be setup in GB: CM

Chief Minister Gilgit Balistan (GB), Hafiz Hafeezur Rehman Thursday said that his government was providing free books to students of class-I to class-X to promote education and 100 model schools would also be setup during next five years in province.
He said these positive measures had significantly increased enrollment in government schools and 1,65,000 children were being provided free books. He said provision of free books would help poor students to continue their studies without financial constraints.

NAVTTC imparting technical skills

To observe the practical training being imparted to the trainees under the current phase of Prime Minister’s Youth Skill Development Program, the executive director NAVTTC, Zulfiqar Ahmad Cheema, visited various training institutes today including Govt. College of Technology, Rasul of District Mandi Bahauddin and Applied Technology Institute, Dina.

Future generations must be protected from toxicity: VC

The Vice Chancellor Sindh Agriculture University, Tando Jam Dr. Mujeebuddin Sahrai on Thursday said that we must protect our future generations from the toxicity effects due to the excessive use of pesticides and chemical fertilizers by raising awareness and promoting use of less toxic alternatives.
He was speaking at a stakeholder’s consultation workshop which was conducted as a part of the study being carried out by Global Environmental Management Services (Pvt) Limited (GEMS) for the Sindh Environmental Protection Agency (SEPA).

SU for innovative student-friendly initiatives

The Vice Chancellor University of Sindh, Prof. Dr. Fateh Muhammad Burfat has launched another innovative initiative of establishing International Standards Organization (ISO) Cell at Syed Ghulam Mustafa Shah Administration Building on Thursday.

21 e-Libraries to be set up in Punjab: Shahbaz

LAHORE: (APP) Headway on the programme of establishing E-Libraries in Punjab was reviewed in a meeting presided over by Punjab Chief Minister Muhammad Shehbaz Sharif here Thursday.

Addressing the meeting, the CM said the Punjab government was setting up state-of-the-art e-libraries in various cities of the province which would give contemplate study opportunities to residents in a conducive atmosphere that would also help to restore dying reading culture.

Fazl asks students to exercise restraint

DERA ISMAIL KHAN: Jamiat Ulema-e-Islam-Fazl (JUI-F) chief Maulana Fazlur Rahman on Thursday urged the seminary students to discourage the use of force and dedicate their lives to the cause of humanity.

He was speaking at the certificate distribution ceremony among the students who completed studies at the Jamiatul Arifia Al-Sharia here. The Maulana said that Islam is the religion of peace, adding the JUI-F believed in a peaceful struggle for implementation of Islamic law in the country.

US students term Hijab symbol of feminism, empowerment

WASHINGTON: While the issue of Hijab for students in Punjab has created a heated debate among mainstream Pakistani political parties, scarf-wearing Muslim students in the United States have termed Hijab a symbol of their empowerment and feminism.

Since the election of President Donald Trump, Hijab is emerging as a symbol of resistance to Islamophobia amid policies from the Trump administration targeting Muslim immigrants. As a part of its series on women of America, a mainstream American newspaper USA Today carried interviews of Muslim university students who defended their right to wear Hijab as an empowering tool.

Tuesday, March 14, 2017

Functions: Overloading and Default Parameters

Function Overloading

The term function overloading refers to the way C++ allows more than one function in the same scope to share the same name -- as long as they have different parameter lists
  • The rationale is that the compiler must be able to look at any function call and decide exactly which function is being invoked
  • Overloading allows intuitive function names to be used in multiple contexts
  • The parameter list can differ in number of parameters, or types of parameters, or both
  • Example: The following 3 functions are considered different and distinguishable by the compiler, as they have different parameter lists
       int Process(double num);    // function 1
       int Process(char letter);              // function 2
       int Process(double num, int position); // function 3
    
  • Sample calls, based on the above declarations
       int x;
       float y = 12.34;
       x = Process(3.45, 12); // invokes function 3
       x = Process('f');  // invokes function 2
       x = Process(y);  // invokes function 1 (automatic type conversion applies)

Functions

Functions

A function is a reusable portion of a program, sometimes called a procedure or subroutine.
  • Like a mini-program (or subprogram) in its own right
  • Can take in special inputs (arguments)
  • Can produce an answer value (return value)
  • Similar to the idea of a function in mathematics

Why write and use functions?

  • Divide-and-conquer
    • Can breaking up programs and algorithms into smaller, more manageable pieces
    • This makes for easier writing, testing, and debugging
    • Also easier to break up the work for team development
  • Reusability
    • Functions can be called to do their tasks anywhere in a program, as many times as needed
    • Avoids repetition of code in a program
    • Functions can be placed into libraries to be used by more than one "program"

Control Structures

Control Structures - Intro, Selection

Flow of Control:

Flow of control through any given function is implemented with three basic types of control structures:
  • Sequential: default mode. Sequential execution of code statements (one line after another) -- like following a recipe
  • Selection: used for decisions, branching -- choosing between 2 or more alternative paths. In C++, these are the types of selection statements:
    • if
    • if/else
    • switch
  • Repetition: used for looping, i.e. repeating a piece of code multiple times in a row. In C++, there are three types of loops:
    • while
    • do/while
    • for