Using the codechum c++
Q: Write a complete C++ program to calculate fibonacci number
A: Fibonacci number A sequence where the next term is the sum of the previous two terms is the…
Q: Explain what is for loop in C Programming
A: Looping indicates: This one for (or plainly for loop) is a dataflow comment in computer programming…
Q: Explain and differentiate between while and do while statement in 'C++' language.
A: Introduction In this question we will explain and differentiate between while and do while statement…
Q: C
A: Approach: The approach of the given program: Declare the variable Using random seeds to create…
Q: Need a ternary operator program using c# language.
A: The answer is
Q: In C++, strings are built-in (part of the language). Select one: True False
A: False
Q: solution for this c++ program
A: C++ program
Q: Define term operator and operand. Explain different operator used in C programming
A: Given: Define terms operator and operand. Explain different operators used in C programming.
Q: program in C Language to compute and print F value
A: Program: // C Program# include <stdio.h>// function to evaluate first expressionfloat F1(…
Q: C program and write output.
A: The purpose of the program is to print the sum of the first 3 array elements. Output 9 Declare and…
Q: In C++, the result produced by the expression (20-2*3)/(6-3) is A 4 NONE D 18 E) 4.67
A: Here we need to consider the precedence and associativity of operator to evaluate the expression.…
Q: Write the program using C Language Only
A: Given :- Write the program come and get sum using C Language Only.
Q: Write a c++ code to print hellow world..
A: output
Q: Write a program in C language to print the pattern given below:
A: C program to solve the given problem is below.
Q: I always get an error on this code while it works on C language
A: Q: Fix the error in the given program
Q: I need solution for these in c++ language in selection statments topic without ( for) in the…
A: Given:
Q: Write the code in C++
A: As we know that we have an unsorted array A of size N. It contains all the non-negative elements…
Q: Q4: Write C++ program to display the first 100 odd numbers.
A: Find Your Code below #include <iostream> using namespace std; int main(){ int i=1,count=0;…
Q: Design the below pattern in the C++ Programming language. String :- Indian i d.
A: Required: Draw the required pattern. Algorithm: 1. Take the required string as input 2.…
Q: Write C++ program to print the following figure: 1 21 32 1 432 1 5432 1
A: Please find the answer below :
Q: how to declare this ? c programming
A: Let us see the answer below.
Q: ******* ******* * * * ** * * *
A: logic:- start a loop from i=0 to 9 (9 rows are there) print("*") if (i==0 || i==9) start a…
Q: Please write the complete C++ program.
A: void HuffmanCodes(char data[],int freq[],int size){ //In minheap we will store a MinHeapNode…
Q: Rewrite the following C program using if-else statements.
A: //code begins #include <stdio.h> int main(void){ int score; printf("Please enter a score…
Q: code for this in C: Write a C program to read 20 numbers from the user and find out the highest…
A: Code:" #include <stdio.h>int main(){ //declaring required variables int i,n,large=0;…
Q: rying to write a gravity function in C language
A: Lets discuss the solution in the next steps
Q: Create a C++ Code
A: Required: Create a C++ Code
Q: IS smaller.
A: Given: Write a program for comparing two input. Numbers if which of the two is smaller.
Q: Write a factorial program in c
A: The algorithm is Function factorial(n) Start Variable fact=1 for i=n to 1, go to step 4 else to…
Q: Explain C# code line by line
A: The current scenario here is to give the explanation to the given c# program. Explanation of…
Q: What are the different types of loop mechanisms in C++? What are the different ways to control…
A: Loop means executes the same statements multiple times The different types of loop mechanisms are:…
Q: Writte a c program for the following pattern
A: Below is the required C program: - Approach: - Include the header file. Define the main function.…
Q: Write a C programming
A: #include <stdio.h>void main(){ int n, k; printf("Enter two numbers :\n"); scanf("%d…
Q: Write a simple C++ code.
A: Given:- Write a simple C++ code.
Q: Write a C# Program to print Number Triangle. attach ouptu also
A: Given: Write a C# Program to print Number Triangle. attach ouptu also
Q: In C# please
A: Note : In csharp we cannot mutate string so we will use String.Replace method to perform changes in…
Q: Write a piece of code to show this output and write the code in C++
A: The C++ code for the given problem is given as follows:
Q: Print "Learn more CPP" in C++. Please print the above line using cout
A: Given string: "Learn more CPP" In C++ any string can be printed using cout function. Syntax:…
Q: pls help with this code in c++.
A: Answers Here is your answer in C++…
Q: Can you please do the coding for c,d and e like how it would be done in Python
A: In this question we have to write Python Program using numpy for matrix c. Using element by element…
Q: Write a program in C language by using switch statement
A: Here is the code in C language by using the switch statement which is mentioned below:
Q: rotate function in C language
A: Program: #include <stdio.h>#include <stdlib.h>// declaration of row and columns in…
Q: 3. Write a program in C language to print the pattern given below:
A: Write a program in C language to print the pattern given below: ******* * * * * * * * * *******…
Q: Design the below pattern in the C++ Programming language. String :- Indian i n TI
A: c++ program to print the given pattern
Q: Write a c# code
A: Code: using System; namespace MyApplication{ class Program { static void Main(string[] args)…
Q: Need help in C program
A: Factor: Factor means any number is divisible by a number and remainder become zero that is called…
Q: Every C program begins execution at the function_________________
A: Answer : - main
Using the codechum c++
![5. Age Category
by CodeChum Admin
It's time for the annual city Sportsfest. All individuals young and old may join but it wouldn't
be fair to match a young player against an older one. So to keep the event fun, we decided to
hold separate tournaments for different age groups. The categories are:
• Child - 0 to 12 years old
Teenager - 13 to 17 years old
• Adult - 18 to 59 years old
• Senior Citizen - 60 years old and above
Let's try to do this as quick as possible by using the power of technology and programming!
Input
1. The age
Constraints
The value of the age is within the range: 0 <= age <= 99
Output
The first line will contain a message prompt to input the age.
The second line will contain the name of the age group depending on the age.
Enter the age: 14
Teenager](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fc8bd001d-f9db-419c-87a7-1c59f8528fb8%2F0af35333-8260-4d2b-bd61-4c388cbd980b%2Fgkghvje_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 2 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
- In an annual charter day celebration of a university, one of the highlights of its celebration is having a concert for a cause in which national personalities were invited. The student body assigned for the conduct of the event, sold tickets for their fund raising for a cause. Tickets are sold according to the following prices. The green ticket is sold at $20, orange ticket at $30 and white ticket at $40. All students of the university are encouraged to support the said event, however the venue could only accommodate 1500 people. Write an algorithm in pseudocode, a flowchart and NS diagrams that determines the total amount of money that will be generated if all tickets are all sold out and likewise print the total money collected.An Art Museum needs to keep track of its artwork and exhibitions. The museum has a collection of artwork. Each piece of art has a unique id [ArtID], an artist, year and title. Artwork is categorized by type. There are two types, paintings and sculptures. Paintings have a paintType and style. Sculptures have a material, height and weight. Artwork is frequently shown in exhibitions. Each exhibition has a unique name, startDate, endDate. A listing of the artwork displayed at an exhibition is also retained. Below is an E-R diagram for a database to help the Art Museum. Provide appropriate names for entities E1, E2, E3, E4 identifiers 11, 12, 13, 14 missing attributes and relationship cardinality RC1 and relationship type RT1. Start_date End_date E1 E1 11 RC1 PaintType Style E3 13 A1 Title Year A/ A A/ A/ A/ A/ A/ A/ A A/ A/ E2 12 A/ E2 E3 E4 11 12 13 14 A1 A2 RC1 RT1 RT1 A2 Height Weight E4 14 Activate Go to SettinThe State of New York certifies firefighters through- out the state and must keep track of all of them, as well as of the state’s fire departments. Each fire department has a unique department number, a name that also identifies its locale (city, county, etc.), the year it was established, and its main telephone number. Each certified firefighter has a unique fire- fighter number, a name, year of certification, home telephone number, and a rank (firefighter, fire lieu- tenant, fire captain, etc.) The state wants to record the fire department for which each firefighter currently works and each firefighter’s supervisor. Supervi- sors are always higher-ranking certified firefighters. Construct a relational database for New York’s fire departments and firefighters.
- Rick and Ryan Enterprises is an agency that specializes in representing clients in the fields of sports and entertainment. Given the nature of the business, some employees are given a company car to drive and each company car must be assigned to an employee. Each employee has a unique employee number, plus an address and set of certifications. Not all employees have earned one or more certifications. Company cars are identified by their vehicle ID and also contain a license plate number, make, model, and year. Employees represent clients. Not all employees represent clients while some employees represent many clients. Each client is represented by one and only one employee. Each client has a unique client number. Additional attributes required for each client are name, address, and date of birth. Draw an ER diagram that shows the entity types and the relationship types for Rick and Ryan Enterprises. While you must name each relationship type and define the structural…Algonquin Homes is a new home builder in Eastern Ontario. They specialize in detached homes on larger lots with quality finishes. They currently have 3 communities that they are building; Westgrove, Apple Hills and Wild Meadow. Each community has a site plan which shows the location of the community within the larger region, the location of each lot in the community including a lot number, and the street names and addresses within that community. Each of these communities has a different number of lots for sale. A number of model homes are available to be built on a lot. Larger lots will allow for a home with a three car garage, while smaller ones will allow only a two car garage. Each model has a number and a name. Each lot has a lot number and lot dimensions – metres wide by metres long. Sometimes, a community sells out fast leaving only 2 or 3 lots unsold. In this case, the builder can reduce the base price of the lot and model home as an incentive to make the sale. The community…The State of New York certifies firefighters throughout the state and must keep track of all of them, as well as of the state’s fire departments. Each fire department has a unique department number, a name that also identifies its locale (city, county, etc.), the year it was established, and its main telephone number. Each certified firefighter has a unique firefighter number, a name, year of certification, home telephone number, and a rank (firefighter, fire lieutenant, fire captain, etc.) The state wants to record the fire department for which each firefighter currently works and each firefighter’s supervisor. Supervisors are always higher-ranking certified firefighters. Construct a relational database for New York’s fire departments and firefighters.
- 3.Rose Theater Company For this assignment you will modify the Rose Theater Company assignment created in chapter 2. Rose Theater company sells tickets to their productions. There are three seating options for purchase at Rose's theater; Orchestra seats, Center Stage seats, and Outer Stage seats. Orchestra seats cost $75 each, Center Stage seats cost $50 each, and Outer Stage seats cost $25 each. The theater company also gives a discount of 5% on tickets to the local theater group members. The user will enter the number of Orchestra, Center State, and/or Outer stage seats the customer wants to purchase along with whether the customer is a member of the local theater group. The program will calculate and display the income from each type of seat sale along with the discount, and total sale. Requirements Must include use of named constants Must include meaningful variable names Must include a main function with a call to the main function. Must include at least one value returning…A rail transport company wishes to hold details of train services, stations and operators. Details include the following: Trains: A train has a unique id code, a collection of days it runs on (Monday, Sunday etc.), and the number of carriages it has. Each train must have at least one driver but can have many drivers that can drive it, and a driver may drive many trains. Each driver is identified by an employee number and a name. A train is designated as either an InterCity or District train though other types of train are possible. Each train must have an operator and not more than one operator. Each operator has a name and a phone number. The operator can operate many trains (or none at all!) Stations: A station has a name and the number of platforms it has. All stations are classified as either Main or District only. There are no other types of stations. Timetable: A train has a number of stops at a station during its journey. It never visits the same station twice on the same…There have been several actors who have played the titular character in the British sci-fi series Doctor Who since the show began in the early 1960s. In 2005 the series was rebooted and Christopher Eccleston, David Tennant, Matt Smith, Peter Capaldi, and Jodie Whittaker have all played the Doctor since. Several Whovians (fans of the show) were asked to rank the actors of the Doctor from their favorite to their least favorite. The results are in the preference schedule below using the initials of each actor (so CE = Christopher Eccleston; DT = David Tennant; etc.). 6 8 12 16 17 18 23 20 1st Choice CE DT DT DT MS MS PC JW 2nd Choice MS CE PC PC JW CE JW CE 3rd Choice DT JW CE JW CE DT DT PC 4th Choice PC MS JW MS PC PC CE DT 5th Choice JW PC MS CE DT JW MS MS Is there a Condorcet winner?Answer: Explain: Do any of the voting methodsPlurality Method, Instant…
- There have been several actors who have played the titular character in the British sci-fi series Doctor Who since the show began in the early 1960s. In 2005 the series was rebooted and Christopher Eccleston, David Tennant, Matt Smith, Peter Capaldi, and Jodie Whittaker have all played the Doctor since. Several Whovians (fans of the show) were asked to rank the actors of the Doctor from their favorite to their least favorite. The results are in the preference schedule below using the initials of each actor (so CE = Christopher Eccleston; DT = David Tennant; etc.). 6. 8 12 16 17 18 23 20 1st Choice DT DT DT MS MS PC JW CE 2nd Choice CE PC PC JW CE JW CE MS 3rd Choice JW СЕ JW CE DT DT PC DT 4th Choice PC MS JW MS PC PC DT PC MS CE DT JW MS MS 5th Choice JW a. Is there a Condorcet winner? Answer: Explain: b. Do any of the voting methods Plurality Method, Instant Runoff Voting Method, Borda Count Method, Copeland's Method violate the Majority Criterion? Answer: Explain:METHOD TO DO THE HOMEWORK PROBLEM: *Create the SDLC model of Shopee. *Choose 2 models below that is best to use in the application.Central Pacific University:On a warm, sunny day in late October, Chip Puller parks his car and walks into his office at CentralPacific University. It feels good to be starting as a systems analyst, and he is looking forward tomeeting the other staff. In the office, Anna Liszt introduces herself. “We’ve been assigned to work asa team on a new project. Why don’t I fill you in with the details, and then we can take a tour of thefacilities?”“That sounds good to me,” Chip replies. “How long have you been working here?” “About five years,”answers Anna. “I started as a programmer analyst, but the last few years have been dedicated toanalysis and design. I’m hoping we’ll find some ways to increase our productivity,” Anna continues.“Tell me about the new project,” Chip says. “Well,” Anna replies, “like so many other organizations,we have a large number of microcomputers with different software packages installed on them. Fromwhat I understand, in the 1980s there were few personal computers and…
![Operations Research : Applications and Algorithms](https://www.bartleby.com/isbn_cover_images/9780534380588/9780534380588_smallCoverImage.gif)
![Operations Research : Applications and Algorithms](https://www.bartleby.com/isbn_cover_images/9780534380588/9780534380588_smallCoverImage.gif)