Write a for-each loop that prints all of the Student objects in an ArrayList<student> object called roster. Write this piece in Java.
Write the correct code to execute.
In: Computer Science
in C++.
Implement a structure to handle a college course information. You will also use functions to manipulate the structure. Follow the instructions step by step to complete the homework successfully.
(1) Create a structure course. The structure should include the following attributes:
Important! The names of the structure and each of its field must match exactly for the program to work and be graded correctly.
Before moving on with the exercise, it is recommended that you self-test your structure in the main function (create a structure, assign values and print them…). Just make sure to remove these changes from the main before you continue.
(2) function getCourseFromFile(). This function takes as argument the name of a file where course information is stored, reads the file, and returns a structure with that information.
The format of the file is the following:
<Course name> <Course code> <Course class size> <Student1> <Student2> <Student3> ...
In the function, open a file stream using the file name passed as argument. If the file is not opened successfully, print
Error! File not found.
Else, read the information from the file into a local structure variable (the variable to be returned). You can assume that the number of students in the file will not exceed the size of the array.
Note that the number of students enrolled is not know and has to be determined while reading the list of names in the file.
This function is tested using unit testing.
(3) function checkCourseSize(). This function takes as argument a course structure and returns true if the number of students enrolled is less or equal the class size, and false otherwise.
This function is tested using unit testing.
(4) function printRoster(). This function takes as argument a course structure and prints all the students to standard output, each one on a new line.
(5) function saveCourseSummary(). This function takes two arguments: a string with the desired output file name, and a course structure. Then saves in the output file the following course summary:
Course title: <title> Course code: <code> Class size: <size> Students enrolled: <enrolled>
Additionally, it uses the function checkCourseSize and if the function returns false (too many students enrolled), it adds to the file the following message:
Enrollment exceeds class size. Drop students or find bigger classroom.
In: Computer Science
What is the Family Educational Rights and Privacy Act (FERPA)? Why was it passed into law? How does it affect the IT part of an organization? (150+ words, please)
In: Computer Science
C++ PROGRAM (Pointers and char arrays)
IMPORTANT NOTES:
1. CHAR ARRAY MUST BE USED.
2. YOU MUST USE POINTERS.
3. YOU MUST USE THE SWITCH STATEMENT TO EXECUTE THE PROGRAM.
4. ALL MODIFICATIONS MUST BE DONE IN THE SAME ORIGINAL CHAR ARRAY WITHOUT CREATING A NEW ONE.
Write a C++ program that modifies a null teminated char array as follows:
Consonants are positioned at the beginning of the string and vowels are moved to the end of the string.
Example :
Original string : density
New string : dnstyei
In: Computer Science
Question: Can you please convert this program into switch case program using c++.
Output should be same
int main()
{
bool weekend = false;
unsigned char day = 0;
bool isDay = true;
cout << " Enter a char for a day of week:";
cin >> day ;
if (day == 'M' || day == 'm')
cout << " This is Monday" << endl ;
else if (day == 'T' || day == 't')
cout << " This is Tuesday" << endl ;
else if (day == 'W' || day == 'w')
cout << " This is Wednesday" << endl ;
else if (day == 'R' || day == 'r')
cout << " This is Thursday" << endl ;
else if (day == 'F' || day == 'f')
cout << " This is Friday" << endl ;
else if (day == 'S' || day == 's')
{
cout << " This is Saturday" << endl ;
weekend = true ;
}
else if (day == 'U' || day == 'u')
{
cout << " This is Sunday " << endl ;
weekend = true ;
}
else
{
cout << day << " is not recognized..." << endl ;
isDay = false;
In: Computer Science
IN JAVA Create a program that uses a nested for loop to display a rectangle of #'s with a given number of rows and columns,. This should only display the # when the column is an odd number (see examples below).
Get the number of rows and columns from the user, and display the result.
Examples:
If the user provided rows=4, and columns=7, the program should display a pattern as follows:
# # # #
# # #
# # # #
# # #
If the user provide rows=2, and columns=5, the program should display a pattern as follows:
# # #
# #
etc.
Upload
In: Computer Science
What is the final value of variable x?
x = 0 msg = "hello there!" for character in msg: if character=="e": x += 1
In: Computer Science
What is the last value of variable x?
y = 0 x = 0 while y<=10: if y%2==0: x = x + 2 y += 1
In: Computer Science
Python 3:
Create functions to draw each of these with sides of
size side:triangle, square, pentagon, hexagon
The function should be the shape + "2d"
Use import turtle and the turtle commands: forward(), left(),
right(), pendown(), penup(), done(), color()
Use the goto(X,Y) function to allow the shape to be drawn at a
specific location
Use the x,y, and side attributes for screen position and
size
In: Computer Science
Briefly Describe three potential concerns that buyers of these smart connected products might have about this trend to smart, connected products.
In: Computer Science
****** please don't copy and paste and don't use handwriting
****** I need a unique answer
Q1: Write HTML code to get the following output that include the following elements.
The title is: Favorite Books
Large heading with text “Your Favorite Books”
Form that has 3 input values (two text boxes and one drop down list)
Drop-down list contains the following options,
Wiley
Mc-Graw Hill
Submit information to “books.php” using GET request.
Q2:Display a simple message "Welcome" on your demo webpage. When the user hovers over the message, a popup should be displayed with a message "Welcome to our new WebPage!!!".
Q3:
Create XHTML and CSS file to show your information. Style the table to match the on in the picture. You are allowed to choose your preferred colors; however, you cannot change the style of the table.
The table must be centered in the page
Heading font is Times New Roman
Text in table cells must be centered
In: Computer Science
Write a script that represents a simple command line calculator. It will accept two numbers from command line, and then display sum, difference and product of these two numbers. Provide script code and screenshot of output.
Using Linux Ubuntu bash
In: Computer Science
In this assignment, you will study databases and differentiate between the various database models and tools available to design databases.
Specify at least two real-life situations where you have seen a database in use and based on your observations, answer the following questions:
Pick one of the database models and list at least two situations in which the model can be applied. You can choose to find the model used in the database that you find in your real-life situation and then answer.
Further, research the Internet for features of the tools that can help you create a database design. You can confine your search to:
Based on your research, would you recommend any of these tools for database design based on the information available on the Internet? Why or why not? You may discuss other tools in addition to these.
In: Computer Science
I NEED THIS IN PSEUDOCODE:
SWITCH/CASE 2 - Complete the pseudocode below by including a SWITCH statement that takes the user input (an integer between 26-30) and prints out a count up in its English equivalent. For example: if the user inputs “26”, the code will print “twenty-six”, “twenty-seven” on the next line, and so on up to “thirty”. If the user inputs “30”, the code will print “thirty” and finish.
CREATE inputNum
PRINT ("Please enter a number between 26-30 to start counting from:")
READ inputNum
WHILE inputNum >= 26 AND inputNum <= 30
BEGIN WHILE
In: Computer Science
IN C++
Implement in C++ a game called “Your Lucky Number”. The lucky number is calculated based on an individual’s birth month, day, and year. The algorithm assigns any person a number between 1 and 9. Many people believe that a group of people with the same lucky number share common features. The lucky number is calculated as the sum of digits of the birth month, day, and year numbers. If this sum is not a single-digit then you need to keep adding up its digits. Use the C++ functions when you implement the game. Test your program for corrections. To start the game you should enter your full birthdate in the format: month day year, e.g. 9 21 1985. The month is represented by its corresponding integer: January is 1, February is 2, ..., and December is 12. Be sure that your program will verify the input format and print an error message when the format is incorrect (use exceptions), and will ask to re-enter the birthdate again. The algorithm for calculating the lucky number
(a) Enter the month as an integer from 1 to 12.
(b) Reduce the month, day and year numbers down to a one-digit number by adding all digits in the month, day and year numbers, see the example below.
(c) Map the number to the category listed below and display the message on the screen with at least four features for a person in each category. I provided only one feature (as an adjective) for each category and you should complete the list.
(d) Test your program using at least 10 your friends’ or relatives’ birthdays.
Categories:
1. The Leader: original thinker (add 3 more features)
2. The Mediator: diplomatic (add 3 more features)
3. The Communicator: expressive (add 3 more features)
4. The Teacher: trustworthy (add 3 more features)
5. The Freedom Seeker: adventurous (add 3 more features)
6. The Nurturer: family-oriented (add 3 more features)
7. The Seeker: analytic (add 3 more features)
8. The Power House: authoritative (add 3 more features) 9. The Humanitarian: charitable (add 3 more features)
In: Computer Science