C++ Coding Exercise (If... Else)
Hello All, I know this question has been asked before, but I was unable to run any of the programs that were posted and I'm stuck. I would like to see an explanation with the code and exactly how to add a .txt file to the program through VS 2019, if possible.
LAB:
Write a C++ program that computes a student’s grade for an assignment as a percentage given the student’s score and total points. The final score must be rounded up to the nearest whole value using the ceil function in the header file. You must also display the floating-point result up to 5 decimal places. The input to the program must come from a file containing a single line with the score and total separated by a space.
In addition, you must print to the console “Excellent” if the grade is greater than or equal to 90, “Well Done” if the grade is less than 90 and greater than or equal to 80, “Good” if the grade is less than 80 and greater than or equal to 70, “Need Improvement” if the grade is less than 70 and greater than or equal to 60, and “Fail” if the grade is less than 60.
In: Computer Science
Python Programming
This assignment will give you practice with
interactive programs, if/else statements, collections, loops and
functions.
Problem Description
A small car yard dealing in second hand cars needs an application
to keep records of cars in stock. Details of each car shall include
registration(rego), model, color, price paid for the car (i.e.
purchase price) and selling price. Selling price is calculated as
purchased price plus mark-up of 30%. For example, Toyota Corolla
bought for $20,000 will have the selling price of 20000 * (1 + 0.3)
= 26000.
Task Requirements
Imagine you have been invited to develop a menu driven python
application to manage records of cars in stock. Based on the
problem description, starter program (code template) has been
provided. Investigate the provided starter program. There are four
scripts(application.py, caryard.py, cars.py and vehicle.py). Driver
function(main) is defined in the appliction.py, which imports
caryard module(caryard.py). Caryard declares all the core functions
(buy, sell, search, etc. …) for supporting the car yard business.
The caryard module imports cars module(cars.py), and the cars
module in turn imports the vehicle that include a definition of a
Car class.
Program is executed by loading and running the application.py. The
important work of interconnecting and wiring of modules and
functions have been already been done. However, most of these
functions, although declared and wired up in the program are not
yet implemented. Your task is to implement these functions. There
are eleven (11) tasks to be completed described next within the
modules:
1. application.py
• Task 1: implement menu ()
2. caryard.py
• Task 2: implement buy_car ()
• Task 3: implement sell_car ()
• Task 4: implement search_car ()
• Task 5: implement list_all_cars ()
3. cars.py
• Task 6: implement addCar (rego, model, color, price)
• Task 7: implement removeCar (rego)
• Task 8: implement all_cars ()
• Task 9: implement search(rego)
4. vehicle.py
• Task 10: implement the Car class
• Task 11: UML model of a Car class
Description of Program functions:
Program displays a menu on execution. Five menu options are
available to allow the user to buy, sell, search, show all cars,
and exit program respectively. Program functionality and screen
output for each of the menu option when selected by the user
follows:
Program menu on execution:
Option 1 (Buy a car): User enters 1. Note the error message for
duplicate car rego
Option 2 (Sell a car): User enters 2. Note the error message for
invalid car rego, and the sell price which is a (30%) mark-up of
purchase price.
Option 3 (Search): User enters 3
Option 4 (Show all): User enters 4
Option 5 (Exit Program): User enters 5
In: Computer Science
Course : Physical Security
Submit a paper on the weaknesses of biometric authentication
Assignment is worth 50 points and 10% of your grade
In: Computer Science
SQL Server
6. Our new system cannot handle Unicode (Links to an external
site.) characters, only ASCII (Links to an external site.)
characters.
The current Productname data type is NVARCHAR, which is unicode,
and might have non-ASCII characters in it. We need to check!
Show the ProductID, and ProductName, and the first location of any
non-Unicode characters. See the note at the bottom for how to find
non-Unicode characters.
In: Computer Science
In: Computer Science
C++ contains some built-in functions (such as itoa and std::hex) which make this assignment trivial. You may NOT use these in your programs. You code must perform the conversion through your own algorithm.
The input values are:
5
9
24
2
39
83
60
8
11
10
6
18
31
27
In: Computer Science
(Minimum 100 words)
1. What are the two different transmission modes? Explain?
2.Define a DC component and its effect on digital transmission.
3. Distinguish between a signal element and a data element
In: Computer Science
Using Python read dataset in the HTML in beautiful way.
You need to read CSV file ( Use any for example, You
can use small dataset)
You need to use pandas library
You need to use Flask
Make search table like YouTube has.
In: Computer Science
In: Computer Science
Design and implement a special purpose system that allows access to doors 1 and 2 (D1 and D2 respectively) by persons who have been given a valid four-bit binary code. The code is entered using four switches: S1, S2, S3, and S4. Each valid switch can be set to 0 or 1. The system gives access to doors according to the following scheme:
Provide a truth table and implement your circuit only using NOR gates. The correct implementation of this circuit should only have two layers of NOR gates.
In: Computer Science
Design a kernel module that creates a /proc file named /proc/jiffies that reports the current value of jiffies when the /proc/jiffies file is read, such as with the command
cat /proc/jiffies
Be sure to remove /proc/jiffies when the module is removed.
Please help with this assignment using C programming and testing in Linux Ubuntu.
In: Computer Science
C and Systems Programming
Part I. Password Strength Meter
Weak passwords are common source of e-mail and social website accounts hacks. To alleviate this problem, pro-grams, often, when the user chooses a new password, determine if it is an adequately strong password. You are to write a function that validates the password strength. The restrictions that we de ne as our de ned level of strength of passwords is the following: the password must be at least eight characters long, and must include at least one uppercase, one lowercase letter, and one digit. The password cannot contain any other characters than letters and numbers. In addition, it must contain at least one string (consecutive letters) of at least four letters long (uppercase letters, lowecase letters, or combination of both). Furthermore, the password should not contain the username (usernames in our login program are not case-sensitive). Remember, failing to write this piece of code in the program correctly may result in accepting weak and vulnerable passwords. Your code helps rejecting such passwords.
bool i s S t r o n g P a s s w o r d ( const char * username , const char * password ) { // TODO : your code goes here .
}
Enter username : vahab
Enter new password : 1234
Your password is week . Try again !
Enter username : vahab
Enter new password : hello
Your password is week . Try again !
Enter username : vahab
Enter new password : 123 v aH aB k7 89
Your password is week . Try again !
Enter username : vahab
Enter new password : m e A c e C S 2 2 1
Strong password !
Part II. Default Password Generator
In this part, you will write a C function generateDefaultPassword(char* default_password, const char* username) that generates a default password randomly, which will be sent to the user to login. The users may wish to change the default password to a password of their own, which should pass the password strength meter you implemented in Part I. The default password generated by this function will be stored in a char array that the default_password is pointing to. Remember, the caller of this function (aka main()) must declare an array before passing it to this function, in order to avoid segmentation fault issues.
The default password must be created randomly (every character should be chosen randomly and independently from all allowed characters) and must have all the requirements of a strong password the user selects (Part I) except the following:
The default password must not be longer than 15 characters.
The default password may or may not satisfy the four consecutive letters requirement.
Implement a new function called isStrongDefaultPassword(const char* username, const char* password) which checks if the default password is strong based on the new constraints. This function is almost identical to your isStrongPassword() function in Part I, but needs some modi cations based on the default password requirements. In a loop, your program should then keep creating random strings and check if all the password
requirements for the default password are met. Once a compliant password is generated, the loop stops and your program displays the generated password in the following form:
Generating a default password...
Generated default password: x1B4fxH81I02
void g e n e r a t e D e f a u l t P a s s w o r d ( char * default_password , const char * username ) {
// TODO : your code goes here .
}
While you are limiting the length of your random password to 15 maximum length, remember that the size of your random password must be random as well.
For both parts, you can write as many helper functions of your own as you like, but as for functions not written by you, you may only use strlen, strcmp, strcpy, and strcat from string.h, and any functions de ned in stdbool.h, stdio.h, ctype.h, time.h, and stdlib.h, only. Your three functions must do exactly as speci ed in this project. You must include all your code relevant to these three functions inside the functions itself. That means, your code must contain these three functions, with the exact function signatures. Your code must compile and run correctly on the Linux lab machines. If we cannot compile your code on the lab machines, you will receive no credit. A small portion of your project grade (5%) is reserved for good code style and adequate comments. While good code style includes many elements, in this class we only grade your projects on suitable variable name choice and indentation.
Here is code for part 1
/**
*
* A password strength meter and a default password generator,
* as defined in the CS221 course website for Project 1.
*
*/
bool isStrongPassword(const char * username, const char
* password) {
//TODO: your code goes here.
return false;
}
/**
* Example: isStrongDefaultPassword("vahab", "Taher3h") returns
false
*/
bool isStrongDefaultPassword(const char* username, const char*
password) {
//TODO: your code goes here.
return false;
}
/**
* This function may *not* call isStrongPassword().
* This function must call isStrongDefaultPassword().
*/
void generateDefaultPassword(char * default_password, const char *
username) {
//TODO: your code goes here.
}
int main(void)
{
//TODO: your code goes here.
return 0;
}
In: Computer Science
***This program is to be created using Python***
Requirements to be numbered in program01.py:
• First Name
• Last Name
• Membership Level
i. Composer
ii. Conductor
iii. Musician
• Seat Preference
i. Orchestra
ii. Main
iii. Balcony
• Meal Type
i. Chicken
ii. Fish
iii. Vegan
• if Composer and Orchestra:
i. “You qualify for these are exceptional seats!”
• if Composer and Main:
i. “The seats in the main section are good seats.”
• if Composer and Balcony:
i. “Interesting, let us know if you want closer seats.”
• if Conductor and Orchestra:
i. “Member level of Composer required if you want to sit in the orchestra section.”
• if Conductor and Main:
i. “The seats in the main section are good seats.”
• if Conductor and Balcony:
i. “Interesting, let us know if you want closer seats.”
• if Musician and Orchestra:
i. “Member level of Composer required if you want to sit in the orchestra section.”
• if Musician and Main:
i. “Member level of Composer or Conductor required if you want to sit in the main section.”
• if Musician and Balcony:
• The concert was wonderful.
• The food was fantastic.
• The seats were superb.
• if Composer and (total score less than 12 or any score less than 4):
i. “Dear Composer, Your survey score of <score> was lower than we would like. Please give us another opportunity soon.”
• Else // Composer
i. “Thank you for being a Composer member and for having a good time!”
• if Conductor and (total score less than 11 or any score less than 3):
i. “Dear Conductor, Your survey score of <score> was lower than we would like. The next time you attend we will be nicer.
• Else //Conductor
i. “Thank you for being a Conductor member and for having a good time!”
• if Musician and (total score less than 10 or any score less than 2):
i. “Dear Musician, Your survey score of <score> was lower than we would like. You will have more fun next time.”
• Else // Musician
In: Computer Science
- Why do you think that usual maintenance for a widely used website is conducted at 12am or 2am.. etc. on weekends? (List three reasons)
- If you believe that a test is successful when it reveals an error then when do you think that it is the time to release a software to market? (Explain in one paragraph)
In: Computer Science
Question 2. The following code defines an array size that sums elements of the defined array through the loop.
#include <stdio.h>
#define A 10
int main(int argc, char** argv) {
int Total = 0;
int numbers[A];
for (int i=0; i < A; i++)
numbers[i] = i+1;
int i =0;
while (i<=A){
Total += numbers[i];
i++;
}
printf("Total =%d\n", Total);
return 0;
}
In: Computer Science