Declare a variable called dft which is the type of Programme structure that you have declared in code given below. Write C statements to perform the following actions to the variable dft.  Assign the value “Diploma in Information Technology” to programmeTitle.  assign the value 4 to mqfLevel  accept a value from the user (keyboard) for the fees

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter2: Basic Elements Of C++
Section: Chapter Questions
Problem 3PE
icon
Related questions
Question

Declare a variable called dft which is the type of Programme structure that you
have declared in code given below. Write C statements to perform the following
actions to the variable dft.
 Assign the value “Diploma in Information Technology” to programmeTitle.
 assign the value 4 to mqfLevel
 accept a value from the user (keyboard) for the fees

#include <stdio.h>

#include <string.h>

//create structure
struct Programme
{
    //declare fields
    string programmeTitle;
    int mqfLevel;
    double fees;
};

int main()
{
   Struct Programme p;    //create Programme
    
    printf("Enter programme title: ");
    scanf("%s", p.programmeTitle);  //input programmeTitle
    
    printf("Enter the level: ");
    scanf("%d",&p.mqfLevel);              //input level
    
    printf("Enter fees: ");
    scanf("%lf",&p.fees);                  //input fees
    
    return 0;
}

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,