Microsoft Visual C#
7th Edition
ISBN: 9781337102100
Author: Joyce, Farrell.
Publisher: Cengage Learning,
expand_more
expand_more
format_list_bulleted
Question
Chapter 6, Problem 9E
Program Plan Intro
Program Plan
1. Below mentioned variables are used
- salesPerson[]− Array that stores the names of a salesperson.
- initials[]− Array that stores the initials of a salesperson.
- input − input variable that reads the initial of a salesperson as string value from the console.
- salesValues[] - Array that stores the number of sales by each salesperson.
- totalSaleAmount − Accumulated sales amount of all the salespeople.
- saleAmount − Sale amount given as input by the user.
Program description:
This Program is for creating a console application that gets the initials of a salesperson and then gets the sale amount by that salesperson. It calculates the total sale amount of each person individually and then calculates the total sale amounts by the entire salespersons. Finally, the salesperson with the highest sales value is displayed.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
do both tasks
You can assign the contents of one array to another by using
the assignment operator.
the equality operator.
both array names.
A and C together.
none of the above.
Create a struct called Booking that consists of a 3 digit flight number (e.g. 234), type of seat (E or B), the price of a seat in economic class and the number of seats booked. Declare an array to store at least 30 Booking structs.
Chapter 6 Solutions
Microsoft Visual C#
Knowledge Booster
Similar questions
- Instructions: In the code editor, you are provided with the definition of a struct Person. This struct needs an integer value for its age and character value for its gender. Furthermore, you are provided with a displayPerson() function which accepts a struct Person as its parameter. In the main() function, there's a pre-created array of 5 Persons. Your task is to ask the user for the values of the age and gender of these Persons. Then, once you've set their ages and genders, call the displayPerson() function and pass them one by one. Input 1. A series of ages and genders of the 5 Persons Source Code: #include<stdio.h> typedef struct { int age; char gender;} Person; void displayPerson(Person); int main(void) { Person persons[5]; return 0;} void displayPerson(Person p) { printf("PERSON DETAILS:\n"); printf("Age: %d\n", p.age); printf("Gender: "); if(p.gender == 'M') { printf("Male"); } else { printf("Female"); }…arrow_forwardYou can copy all elements of one array into one another with an assignment statement. True or Falsearrow_forwardIn visual basic Write the code that will sequentially search through the array strFirstNames and will print out the word "Found" if the name "Brian" is in the array.arrow_forward
- For this exercise, please calculate two values from all of the numbers in the two dimensional array. The first value should be the sum of all numbers in the array. This should be stored in a separate "int" variable that is created outside the nested FOR loops. The second value should be the total average of all numbers in the Array. This should be stored in a separate "float" variable, also outside the nested FOR loop structure. So, in short: • Display the sum of the values in the array • Then display the average of the values in the array Please refer to the sample output below for visualization and match its style. As always: • Remember, the class name should be Lab9B. The user input is indicated in bold. Sample Output #1: Please enter the number of rows: 3 Please enter the number of columns: 2 I have 3 rows and 2 columns. I need to fill-up 6 spaces. The 3x2 array: 1|2| 314| 516| The sum of all the numbers in the 3x2 array: 21 The average of all the numbers in the 3x2 array: 3.5…arrow_forward1. Create a struct called Booking that consists of a 3 digit flight number (e.g. 234), type of seat (E or B), the priceof a seat in economic class and the number of seats booked.Declare an array to store at least 30 Booking structs. 2. The user must be able to enter the information for a number of bookings from the keyboard. Ask whether abooking must be made (Y or N). If a booking must be made, a random 3 digit flight number must be generated.The user must be asked to enter the type of seat, the price per seat and the number of seats to book.Example of input:arrow_forwardExercise Three: In this exercise, we are storing the user's test score. You need to know, how many test score you want to enter. · Ask the user to enter the size of the array. Input Validation: Don't make the array size zero, less than zero, and more than 5 (to keep the calculation simple). If the user enters wrong number, make him/her to enter again until he/she enters the acceptable number. . Then ask the user to enter his/her test score. Input Validation: User can't enter any score number less than O or greater than 100. If s/he enters, do not terminate the program. Ask the user to enter the number again until s/he gets it right. Hint: Feel free to combine one loop inside another loop. • Print them out they he/she has entered. Do not include those numbers in the test score array that is less than 0 or greater than 100. • Print them in reverse order (Note: you are not reversing the array, you are just printing them in reverse order) • Create an array and store all his even number…arrow_forward
- In order to access each element in an array, the For...Next statement needs to know the highest subscript in the array. True or False?arrow_forwardFor each of the following exercises, you may choose to write a console-based or GUI application, or both. Write a program named CheckZips that is used by a package delivery service to check delivery areas. The program contains an array that holds the 10 zip codes of areas to which the company makes deliveries. Prompt a user to enter a zip code, and display a message indicating whether the zip code is in the companys delivery area.arrow_forward1. Create a struct called Booking that consists of a 3 digit flight number (e.g. 234), type of seat (E or B), the priceof a seat in economic class and the number of seats booked.Declare an array to store at least 30 Booking structs. (4)2. The user must be able to enter the information for a number of bookings from the keyboard. Ask whether abooking must be made (Y or N). If a booking must be made, a random 3 digit flight number must be generated.The user must be asked to enter the type of seat, the price per seat and the number of seats to book.3. Write code to display a numbered list with all the information of all the bookings. The price per ticket must bedisplayed with 2 decimal places. The output must be displayed with a heading and subheading 4. Write code to calculate and display the income earned per booking. Display headings and subheadings.Also count and display the number of business seats and economics seats booked as well as the incomeearned from each of these types of…arrow_forward
- Code Should Be in Java: use loops, if statements, arrays, scanner etc Write an application that stores at least five different college courses (such as CIS101), the time it first meets in the week (such as Mon 9 am), and the instructor (such as Johnson) in a two-dimensional array. Allow the user to enter a course name and display the corresponding time and instructor. If the course exists twice, display details for both sessions. If the course does not exist, display an error message. Save the file as TimesAndInstructors.javaarrow_forwarda class with 10 students that will take 3 exams use 3 arrays to hold the scores for each student and anoither array to hold the average of the 3 exams for each student. Print the table with the scores and averagearrow_forwardPls, explain how this program question applies to the code below and comment on it in the program. for example, comment the which part of the question applies to the code and how it worksarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning