How would I assign the third letter from the email field to a local char variable called myChar

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter2: Using Data
Section: Chapter Questions
Problem 3RQ
icon
Related questions
Question
100%

How would I assign the third letter from the email field to a local char variable called myChar. Using a code a wrote earlier

 

#include <iostream>

 

using namespace std;

 

 

enum Major {

    COMPUTER_SCIENCE,

    COMPUTER_SECURITY_INFO_ASSURANCE,

    CYBER_SECURITY,

    ELECTRICAL_ENGINEERING,

    OTHER

};

 

struct Name

{

    string  first;

    string  last;

    char    middleInitial;

};

 

struct StudentRecord

{

    Name    studentName;

    Major   major;

    string  email;

};

 

StudentRecord student12;

 

int main()

{

    StudentRecord student12;

    student12.studentName.first = "John";

    student12.studentName.last = "Doe";

    student12.studentName.middleInitial = 65;

    student12.major = CYBER_SECURITY;

    student12.email = "Jdoe@stu.texas.edu";

 

    cout << student12.studentName.first << " " << student12.studentName.middleInitial << " " << student12.studentName.last << " " << student12.major << " = CYBER_SECURITY  " << student12.email << endl;

    return 0;

}

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Study of Characters
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT