Write a python program that will ask the user to enter any number of days. The program reads the number of days from the user, and returns how many years, months, and days are there in the given number of days.
Your program should prompt the user to:
Enter the number of days : 1152
The user types number of days (1152 above, for example) and hit
enter key.
The program then will print:
3 years
1 months
27 days
Another example of the program input and output:
Enter the number of days : 300000
821 years
11 months
5 days
Notice the indentation of the output
Marking rubrics of Question 1:
1 mark for reading an input.
1 mark for finding number of years
1 mark for finding number of months
1 mark for finding number of days
1 mark for coding style
Full 1 mark for each correct answer, and ½ mark for partially correct answer.
please pay attention to output format
In: Computer Science
Hello i need pesodocde of this code.
void accountInfo()
{
system("cls");
int ch;
printf("1-Total Amount Claimed by LifeTime Claim Limit
subscriber\n");
printf("2-Total number of Annual Claim Limit who have exhausted all
their eligible amount\n");
scanf("%d", & ch);
if (ch == 1)
{
int totalAmountClaimedByLifeTimeSubs = 0;
for (int i = 0; i < patientCount; i++)
{
if (patients[i].annualClaim == false)
{
for (int j = 0; j < patientCount; j++)
{
if (claims[j].id == patients[i].id)
{
totalAmountClaimedByLifeTimeSubs += claims[j].amountClaimed;
}
}
}
}
printf("\nTotal amount Claimed By LifeTime Subscribers is: %d\n",
totalAmountClaimedByLifeTimeSubs);
} else
{
int count = 0;
for (int i = 0; i < patientCount; i++)
{
if (claims[i].remaininigAmount <= 0 &&
patients[i].annualClaim == true)
count++;
}
printf("Total number of Annual Claim Limit Subcriber who have
exhausted all their amount are: %d\n", count);
}
system("pause");
}
void searchingFunctionalities()
{
system("cls");
int ch;
printf("1-Search by ID\n2-Search by age\n");
scanf("%d", & ch);
if (ch == 1)
{
int id;
printf("Enter patient ID for which you want Search: ");
scanf("%d", & id);
int i;
for (i = 0; i < patientCount; i++)
{
if (patients[i].id == id)
{
printf("\nSubscriber Name: %s\nSubscriber Age: %d\nSubscriber
Contact: %s\nSubscriber Address: %s\n", patients[i].name,
patients[i].age, patients[i].contactNum,
patients[i].address);
break;
}
}
printf("Subscriber Not Found");
} else
{
int age;
printf("Enter age for which you want Search: ");
scanf("%d", & age);
for (int i = 0; i < patientCount; i++)
{
if (patients[i].age == age)
{
printf("\nSubscriber Name: %s\nSubscriber ID: %d\nSubscriber
Contact: %s\nSubscriber Address: %s\n", patients[i].name,
patients[i].id, patients[i].contactNum, patients[i].address);
}
}
}
system("pause");
}
In: Computer Science
} 1. write a function that takes a string as parameter, return true if it’s a valid variable name, false otherwise. You can use keyword module’s iskeyword() to determine is a string is keyword.
import keyword
keyword.iskeyword(var) #returns true or false
}2. write a function that returns the length of a string (without using len() function)
}3. write a function that counts number of vowels in a string
}4. write a function that checks if a word is palindrome
PYTHON PROGRAMMING
In: Computer Science
1. Give at least 5 reasons why we should learn the
subject Operating System. (10pts)
2. Give at least 5 examples of Operating System. Attach actual
pictures of each OS after the installation.
(10pts)
3. Explain why OS is an important part of almost every computer
System. Minimum 10 Sentences. (10pts)
4. Explain the diagram of Computer System which includes (Hardware,
OS, application program and users). (10pts)
5. The five major activities of an operating system in regard to
process management are? (5pts)
6. Difference Between RAM and ROM?
In: Computer Science
JAVA
Lab 9: Phone Call
Write a program that will calculate the cost of a phone call as follows:
Include all Prologue information with your program
1. 9 minutes
2. 10 minutes
3. 11 minutes
4. 35 minutes
5. 0 minutes
NOTE 1:
NOTE 2:
1. Declare all variables within the data
declaration section of each class and
method. (-.1)
2 Do not get input on the same line as a variable
declaration. (-.1)
3. Do not place an equation for computation on the same line as
declaring a variable. (-.1)
4. Do not place an equation for computation on the
same line as an input statement. (-.1)
5. Do not place any
computations within an output statement.
(-.1)
In: Computer Science
I am getting the fallowing error when I compile my application:
mingw32-g++.exe -Wall -fexceptions -g -c E:\vmmar\Area\area\main.cpp -o obj\Debug\main.o
E:\vmmar\Area\area\main.cpp: In function 'int main()':
E:\vmmar\Area\area\main.cpp:41:15: error: 'setRadius' was not declared in this scope
setRadius(rad);
^
E:\vmmar\Area\area\main.cpp:42:15: error: 'setShapeId' was not declared in this scope
setShapeId(id);
^
E:\vmmar\Area\area\main.cpp:43:23: error: 'setUnitOfMeasure' was not declared in this scope
setUnitOfMeasure(unit);
^
E:\vmmar\Area\area\main.cpp:44:23: error: 'setShapeType' was not declared in this scope
setShapeType("Circle");
^
E:\vmmar\Area\area\main.cpp:45:41: error: 'getArea' was not declared in this scope
cout << "Area of Circle : " << getArea() << endl;
^
E:\vmmar\Area\area\main.cpp:46:10: error: 'display' was not declared in this scope
display();
^
E:\vmmar\Area\area\main.cpp:57:13: error: 'setLength' was not declared in this scope
setLength(l);
^
Process terminated with status 1 (0 minute(s), 0 second(s))
7 error(s), 0 warning(s) (0 minute(s), 0 second(s))
######################################################################################################################
The following is my entire application:
#ifndef SHAPE_H_INCLUDED
#define SHAPE_H_INCLUDED
#include <iostream>
using namespace std;
const float PI = 3.1415926;
class Shape{
private:
string shapeType;
string shapeId;
string unit_of_measure;
public:
Shape(){}
Shape(string id){
shapeId = id;
}
Shape(string Id, string type, string unit){
shapeId = Id;
shapeType = type;
unit_of_measure= unit;
}
string getShapeType(){
return shapeType;
}
string getSgapeId(){
return shapeId;
}
string getUnitOfMeasure(){
return unit_of_measure;
}
void setShapeType(string type){
shapeType = type;
}
void setShapeId(string id){
shapeId = id;
}
void setUnitOfMeasure(string unit){
unit_of_measure = unit;
}
virtual float getArea() = 0;
};
#endif // SHAPE_H_INCLUDED
###############################################################################################################################
#ifndef AREACIRCLE_H_INCLUDED
#define AREACIRCLE_H_INCLUDED
#include "Shape.h"
using namespace std;
/* Circle Class */
class Circle:public Shape
{
private:
float radius;
public:
/* set value for radius */
void setRadius(float rad)
{
radius = rad;
}
/* get the value of radius */
float getRadius()
{
return radius;
}
// float radius;
}; //float areaCircle;
#endif // AREACIRCLE_H_INCLUDED
###############################################################################################################################
#ifndef AREASQUARE_H_INCLUDED
#define AREASQUARE_H_INCLUDED
#include "Shape.h"
using namespace std;
class Square:public Shape
{
private:
float sidelen;
public:
/* get the value of length */
float getLength()
{
return sidelen;
}
/* set value for length */
void setLength(float l)
{
sidelen = l;
}
};
#endif // AREASQUARE_H_INCLUDED
################################################################################################################################
#include <iostream>
#include "Circle.h"
#include "Shape.h"
using namespace std;
/* Constructor */
Circle():Shape()
{
{
radius = 0;
}
/* Copy Constructor, which takes a parameter */
Circle(string id, float rad):Shape(id)
{
radius = rad;
}
Circle(string id, string type, string unit, float rad):
Shape(id, type, unit){
radius = rad;
}
/* Method to calculate the area of circle */
float getArea()
{
return PI*radius*radius;
}
void display(){
cout<<"Shape Id: "<<getSgapeId()<<endl;
cout<<"Shape Type: "<<getShapeType()<<endl;
cout<<"Unit of Measure: "<<getUnitOfMeasure();
cout<<"Area: "<<getArea()<<endl;
cout<<endl;
}
}
#################################################################################################################################
#include <iostream>
#include "Square.h"
#include "Shape.h"
using namespace std;
Square():Shape()
{
{
sidelen = 0;
}
/* Copy Constructor, which takes a parameter */
Square(string id, float l):Shape(id)
{
sidelen = l;
}
Square(string id, string type, string unit, float l): Shape(id,
type, unit)
{
sidelen = l;
}
/* Method to calculate the area of circle */
float getArea()
{
return sidelen * sidelen;
}
void display()
{
cout<<"Shape Id: "<<getSgapeId()<<endl;
cout<<"Shape Type: "<<getShapeType()<<endl;
cout<<"Unit of Measure: "<<getUnitOfMeasure();
cout<<"Area: "<<getArea()<<endl;
cout<<endl;
}
}
####################################################################################################################################
#include <iostream>
#include "Square.h"
#include "Circle.h"
#include "Shape.h"
using namespace std;
int main()
{
/*Circle = circle1;
Square = square1;
*/
float rad;
float l ;
int menuOption;
string id, type, unit;
do
{ // Starting of while loop
cout << endl << "=========CALCULATE
AREA================" << endl;
cout<< endl
<< "Select an Object" << endl
<< " 1: Circle" << endl
<< " 2: Square" << endl
<< " 0: Exit" << endl
<< " Enter Your Choice: ";
cin >> menuOption;
switch(menuOption)
{
case 1:
cout<<"Enter shape id: ";
cin>>id;
cout<<"Enter unit of measure: ";
cin>>unit;
cout<< "Enter radius of the circle : ";
// float rad;
cin >> rad;
setRadius(rad);
setShapeId(id);
setUnitOfMeasure(unit);
setShapeType("Circle");
cout << "Area of Circle : " << getArea() <<
endl;
display();
break;
case 2:
cout<<"Enter shape id: ";
cin>>id;
cout<<"Enter unit of measure: ";
cin>>unit;
cout<< "Enter length of one side of the square : ";
//float l ;
cin >> l;
setLength(l);
setShapeId(id);
setShapeType("Square");
setUnitOfMeasure(unit);
display();
cout << "Area of Square : " << getArea() <<
endl;
break;
}
} while(menuOption!=0);
{
cout << endl<< endl <<
"============== THANK YOU ===================" <<
endl<< endl;
return 0;
}
}
##############################################################################################################################
In: Computer Science
ASAP Use python please!!
Write a program including binary-search and merge-sort in Python.
You also need to modify the code posted and use your variable names and testArrays.
In: Computer Science
You are to write a short program asking the user to input a single character. Specifically, your prompt should be to ask the user to input a vowel - A, E, I , O or U. (We will not use Y ). Your program should then determine if they did indeed type in a vowel (upper or lower case is acceptable for user input for the vowel). You should use data type char for input!
If they did, you print a short message thanking them for following directions.
If they did NOT input a vowel, you print out a short message telling them that they did NOT follow the instructions.
You should use the switch statement construct to solve this problem.
I need help writing this in C++
In: Computer Science
Don't attempt if you can't attempt fully, i will dislike and negative comments would be given Please it's a request.
c++
We will read a CSV files of a data dump from the GoodReads 2 web
site that contains information
about user-rated books (e.g., book title, publication year, ISBN
number, average reader rating,
and cover image URL). The information will be stored and some
simple statistics will be
calculated. Additionally, for extra credit, the program will create
an HTML web page based on
the top n highest rated books. As is typical of many subject matter
information sources, the data
in the file contains various errors. As such, we will track the
errors and create an exceptions files
to track the lines with data errors.
Develop a class, bookDataType, to provide functionality for reading
and storing book
information. The UML class specifications are provided below. A
main will be provided that
uses the bookDataType class.
●
Book Data Type Class
The class will implement the functions.
bookDataType
-COL_LIMIT = 23: static constexpr unsigned int
-TOP_LIMIT = 20: static constexpr unsigned int
-booksFileName: string
-webPageFileName: string
-exceptionsFileName: string
-bookCount: unsigned int
1 For more information, refer to:
https://en.wikipedia.org/wiki/Comma-separated_values
2 See: www.goodreads.com-topBooksLimit: unsigned int
-*topBooks: unsigned int
-struct bookErrsStruct
-bookIDErrors: unsigned int
-bookYearErrors: unsigned int
-AveRatingErrors: unsigned int
-duplicateDataErrors: unsigned int
-bookErrInfo: bookErrsStruct
-struct bookStruct
-bookTitle: string
-isbn: string
-pubYear: short
-aveRating: float
-imageURL: string
-bookID: unsigned int
-*bookInfo: bookStruct
+bookDataType()
+~bookDataType()
+getBookArguments(int, char *[], string &, bool &):
bool
+getBookFileName() const: string
+getWebPageFileName() const: string
+getExceptionsFileName() const: string
+getReadBookIDErrors() const: unsigned int
+getReadBookYearErrors() const: unsigned int
+getReadBookAveRatingErrors() const: unsigned int
+getReadBookDuplicateErrors() const: unsigned int
+getTopBooksLimit() const: unsigned int
+showBookData(unsigned int) const: void
+getBookCount() const: unsigned int
+getAverageOverallRating() const: float
+showHighestRatedBooks() const: void
+readBookData(const string): bool
+buildWebPage(const string="CS 202 Top Books") const: bool
+findHighestRatedBooks(): void
+setWebPageFileName(const string): void
+setExceptionsFileName(const string): void
+setTopBooksLimit(unsigned int): void
-parseLine(string, string []) const: void
Note, points will be deducted for insufficient commenting, poor
style, or inefficient coding. The
error messages should be prefixed with the function name (to help
better identify the source of
the error). Refer to the sample execution for error message
examples.Function Descriptions
•
The bookDataType() constructor should set the books filename to the
empty string, the
bookCount to 0, the topLimit to a default value of 5, the error
counts to 0, the web page
file name to a default value of “index.html”, and the exceptions
file to a default value of
“errors.txt”, and the pointers to the nullptr.
•
The ~bookDataType() destructor should delete the dynamically
allocated arrays, set the
other class variables to their default values (noted above).
•
The getBookArguments() function should read the command line
qualifiers in the
required format ( -i <booksFileName> [<-show|-noshow>]
) to obtain the file
name and set the show extra information flag (true/false). The data
file and show extra
flag may be in either order. The show extra flag is optional and
the “-noshow” is the
default if not specified. This includes a usage message and error
messages for both the
input file specifier and the input file name. The file name must be
at least one letter and
include a “.csv” extension (thus, the minimum length is 5). If the
file name is incorrect or
does not exist, an appropriate error message should be displayed,
the class variable
should remain unchanged, and the function should return false. To
determine if a file
exists (without opening it), you can use the access() function
(i.e,
( access(fn.c_str(), F_OK) ) which returns a 0 if the file exists
and returns a -1 if
the files does not exist. Note, the access() function requires the
#include <unistd.h>
statement. If there is an error, the function should output one of
the following error
messages:
cout
cout
cout
cout
cout
•
•
•
•
•
•
•
•
•
<<
<<
<<
<<
<<
"Usage:
"Error,
"Error,
"Error,
"Error,
./books -i <bookDataFileName> [<-show|-noshow>]"
<< endl;
invalid input file name specifier." << endl;
invalid command line options." << endl;
book data file name must be '.csv' extension." << endl;
invalid show extra information specifier." << endl;
based on the specific error.
The getBookFileName() function should return the current book file
name.
The getWebPageFileName() function should return the current web
page file name.
The getReadBookIDErrors(), getReadBookYearErrors(),
getReadBookAveRatingErrors(), and getReadBookDuplicateErrors()
functions should
return the applicable structure field.
The getExceptonsFileName() function should return the current
exceptions file name.
The setBookFileName() function should set the class variable for
the books file name to
the passed file name. The file name must be at least one letter and
include a “.csv”
extension (thus, the minimum length is 5). If the passed file name
is correct and the file
exists, the class variable should be set and a true returned. If
the file name is incorrect or
does not exist, an appropriate error message should be displayed,
the class variable
should remain unchanged, and the function should return false. To
determine if a file
exists (without opening it), you can use the access() function
(i.e,
( access(fn.c_str(), F_OK) ) which returns a 0 if the file exists
and returns a -1 if
the files does not exist..
The setWebPageFileName() function should set the class variable for
the web page file
name to the passed file name. The file name must be at least one
letter and include a
“.html” extension (thus, the minimum length is 6).
The setExceptonsFileName() function should set the class variable
for the file name to
the passed file name. The file name must be at least one letter and
include a “.txt”
extension (thus, the minimum length is 5).
The getTopBooksLimit() function should return the value for the
current number of
highest rated books to be found.
The setTopBooksLimit() function should set the class variable for
the current number of
highest rated books to be found. The value must not exceed the
TOP_LIMIT constant. If
the passed value is out of range, nothing should be changed.•
•
•
The getBookCount() should return the current number of books in the
data set.
The getAverageOverallRating() function should return the overall
average of book rating
in the entire current data set.
The showBookData() function should display the formatted book
information to the
screen in the specified format (see output example).
cout
cout
cout
cout
cout
cout
cout
•
•
•
•
•
<<
<<
<<
<<
<<
<<
<<
"Book Information:" <<
offset << "Title:
"
offset << "Book ID
"
offset << "ISBD:
"
offset << "Year:
"
offset << "Ave Rate: "
endl;
endl;
<< bookInfo[idx].bookTitle << endl;
<< bookInfo[idx].bookID << endl;
<< bookInfo[idx].isbn << endl;
<< bookInfo[idx].pubYear << endl;
<< bookInfo[idx].aveRating << endl;
The showHighestRatedBooks() function should show the topBooksLimit
number of
highest rated books using the showBookData() function from the
topBooks array. As
such, the findHighestRatedBooks() function must have been
previously called.
The findHighestRatedBooks() function should find the topBooksLimit
number of highest
rated books. This will require dynamic creation and population of
the topBooks[] array
of topBooksLimit size. The array will hold the index of the book
into the bookInfo[]
array. Due to the data size, a sort is not appropriate. The
topBooksLimit number of
highest rated books should be determined with out performing a
sort.
The parseLine() function will accept a string in comma-separated
format and break the
string into its individual comma separated fields. This includes
handling quoted fields
that may contain commas which are not field separators when inside
quotes. The
function should populate the passed array with the COL_LIMIT fields
in string format.
If the line contains more than COL_LIMIT fields, only the first
COL_LIMIT should be
returned (thus, do not over-write the array).
The readBookData() function should read the books file (CSV
format). This function
will call the private parseLine() function. From the returned
string array, the following
fields should be placed into the applicable fields of bookInfo[]
array.
•
Book title (first title), string
◦ note, of first title is empty, use second title
•
ISBN (10 digit), string
•
ImageURL (first of two), string
•
Publication Year, short
•
Book ID (good reads book ID, which is first), unsigned
integer
•
Average Rating, float
Note, since some data field may be invalid, try/catch blocks must
be used for the
conversion. The first line is a header line and must be skipped.
Blank lines should be
skipped. In order to size the bookInfo[] struct array, you will
need to read the file twice;
once to count the data lines and again to read the data. To reset
the file to the beginning,
use inFile.clear(); followed by inFile.seekg(0, ios::beg); . To
convert
string values into floats or integers, use the stoi() and stof()
functions. In order to check
for errors, these should be performed within a try/catch block.
Errors should be written
to the exceptions file with a line of 60 ‘-’s, the specific error,
the line number (from the
source data file), and on the next line the title “Row Data:”, and
on the next line the
complete row followed by a blank line. Refer to the examples for
formatting. Duplicate
rows are determined by the same book ID number and the second
occurrence written to
the exceptions file. See examples for formatting.
EXTRA CREDIT (up to 25 pts) → The buildWebPage() function should
build an HTML
web page of the top topBooksLimit number of highest rated books
including a link to the
image and the book information on the GoodReads web site. The Good
Reads link is
generated by appending the book ID to the URL"
https://www.goodreads.com/book/show/ " within an HREF tag along
with the
title. For example, <a
href=https://www.goodreads.com/book/show/24812>The
Complete
Calvin and Hobbes</a> for book ID 24812. The passed string is
the web page title
(using <title>CS 202 Top Books Page</title> in the
header block) and the initial we page
label (using an <h1>title</h1> tag) with a subtitle of
“Top Rated Books” (using an
<h2>subtitle</h2> tag). The minimum requirements for
the web page include the
title and subtitle headers, followed by the books. The books must
be numbered (1, 2, ...),
include the good reads book information link, the book cover image,
the ISBN number
(10 digit), and the book average rating. See the provided example
for a minimal required
format. The full 25 points will only be awarded if the final web
page exceeds the
minimal formatting (see example).
Refer to the example executions for output formatting. Make sure
your program includes the
appropriate documentation. See Program Evaluation Criteria for CS
202 for additional
information.
Make File:
You will need to develop a make file. You should be able to
type:
make
Which should create the executable. The makefile will be very
similar to the previous
assignment makefiles.
Submission:
● Submit a zip file of the program source files, header files, and
makefile via the on-line
submission. All necessary files must be included in the ZIP
file.
The grader will download, extract, and type make (so you must have
a valid, working makefile).
CSV Format
Fields in a CSV file are comma-separated. Typically (but not
always), the first line of the file
contains a row showing the field names. This is the case for our
data files. A field may contain
a number or may be quoted (that is, enclosed within double-quote
characters) indicating string
fields such as book titles. Such strings (names/titles) may have
embedded commas and
embedded quote characters (which must be double-quoted). For
example,
,"J.K. Rowling, Mary GrandPré, Rufus Beck",
,"A Child Called ""It"": One Child's Courage to Survive",
,"""M"" is for Malice",
,"""Who Could That Be at This Hour?""",
The double-quotes are used to mark a string field and are not
actually part of the string. For
example, the first line (above) is actually J.K. Rowling, Mary
GrandPré, Rufus Beck .
Where the double-quotes mark only the start and end. Since the
double-quote is used to mark the
start and end of a field, a double double-quote is used to signify
an actual double-quote. For
example, the second line is A Child Called "It": One Child's
Courage to
Survive , the second line is "M" is for Malice , and the third line
is "Who Could That
Be at This Hour?" .These requirements can make the reading of CSV
files a challenge. In addition, may data
sources in CSV format have imperfect data with various errors
include invalid numeric values,
too few fields, or too many fields.
Try/Catch Block Example
Below is an example of how to use the try/catch block for
conversion using the C++ stoi()
function.
unsigned int
unsigned long
string
try {
someNumber = 0;
size = 0;
badNum = "12-34";
someNumber = stoi(badNum, &size);
if (size != columns[8].size())
throw
invalid_argument("Conversion Error");
}
catch (exception &err) {
errFile << err.what() << endl;
}
In: Computer Science
In-Class coding exercise: (try - catch) (pass / fail)
The purpose of this in-class coding exercise is to simulate various exception conditions using the program provided.
package com.InClass;
/*
* This program demonstrates the ability of catching different types
of exceptions"
* You will have to modify the method() codes to trigger
various/different exceptions.
* inClass Coding ( you will have to remove (comment out) the
previous error condition before moving to trigger the next)
* 1) throw a myExcept exception (this is defined with an extends to
Exception (see code)
* 2) use method () to trip a Arithmetic exception
* 3) use method () to trip a nullPointException
* 4) use method () call to trip a runtime exception
* 5) inside the myExcept error to inject an arithmetic error and
watch it behave differently from step1 22
*
*/
public class TestExceptions {
public static void main(String[] args) {
try {
// throw
myException() first.
method();
System.out.println(" after the method call");
}
catch (MyExcept ex){
System.out.println(" MyExcept error");
}
catch (ArithmeticException
ex){
System.out.println(" ArithmeticEx error");
}
catch (NullPointerException ex)
{
System.out.println(" nullPointException !!! ");
}
catch (IndexOutOfBoundsException e)
{
System.out.println(" index out of bounds...");
}
catch (RuntimeException ex )
{
System.out.println(" Runtime exception");
System.out.println(ex.getMessage());
}
catch (Exception e ) {
System.out.println(" Exception");
}
finally {
System.out.println(" finally After
the catch");
}
}
static void method() throws Exception {
// create ArithmeticException
// create RuntimeExceptiom
// create a null point exception here -- fix the exception above
first
// create a ClassCastException here which is NOT on catch "watch"
listed above
// throw new Exception(); // trigger an Exceptiom
}
}
class MyExcept extends Exception { // creating your custome
error
MyExcept(){
// int y = 1/0; // uncomment this
line to introduce an aritmetic exception inside your MyExcept
System.out.println(" inside my custome
MyExcept");
}
}
Please complete the missing exceptions. Ignore the spellings mistakes/grammer, it's how the professor writes.
Instructions might be a bit hard to follow so please bear that in mind. Complete as much as possible.
Thank you.
In: Computer Science
Please write a conclusion about data structure and algorithm
i need an conclusion for my Data Structure and algorithm thesis
i am writing a thesis i need conclusion topic is Data Structure and algorithm
In: Computer Science
Could you include little explanation.
What is a system call to replace the process image? If successful, what is its effect on the process that calls it?
When scheduling processes, provide an example of how round-robin which is known as one of the fairer systems, can be unfair on a multi-user system.
What is the difference between a semaphore and mutex? When would you use one over the other?
In: Computer Science
So I'm writing a function in javaScript that will take a user full name in one text box. "first" space "last name" But if the user does not enter the space then there should be an error. So I'm looking for a way to validate this so the user needs to enter the space.
In: Computer Science
In C programming, Thank you
Declare an array that can contain 5 integer numbers.
Use a for loop to ask the user for numbers and fill up the array
using those numbers.
Write a program to determine the 2 largest integers in the array,
and print those numbers.
Hint: You can declare integer variables “largest” and “secondLargest” to keep track as you make comparisons using the if...elseif statement.
The following is an example of how your program should look when you execute it:
Enter a number to store in the array: 10
Enter a number to store in the array: 91
Enter a number to store in the array: 145
Enter a number to store in the array: 94
Enter a number to store in the array: 97
The largest number is 145
The second largest number is 97
In: Computer Science
Python Language Only!
Python Language Only!
Python Language Only!
Python 3 is used.
When doing this try to use a level one skill python, like as if you just learned this don't use anything advanced if you can please. If not then do it as you can.
Assume you have a file on your disk named floatnumbers.txt containing float numbers. Write a Python code that reads all the numbers in the file and display their average. Your code must handle any IOError (for example, file does not exist) and ValueError (for example, alphanumeric data found in the file such as letters) exceptions.
In: Computer Science