This is from Microsoft Visual C#: An Introduction to Object Oriented Programming by Joyce Farrell (7th Edition)
The provided file has syntax and/or logical errors. Determine the problem(s) and fix the program.
/*
The program requires the user to guess the number of days it takes to make X amount of money when doubling the value every day.
The starting value is $0.01.
The program indicates if the guess is too high, or too low.
*/
using System;
using static System.Console;
using System.Globalization;
class DebugFive4
{
static void Main()
{
const double LIMIT = 1000000.00;
const double START = 0.01;
string inputString;
double total;
int howMany;
int count;
Write("How many days do you think ");
WriteLine("it will take you to reach");
Write("{0 starting with {{1}",
LIMIT.ToString(C), START.ToString("C", CultureInfo.GetCultureInfo("en-US"));
WriteLine("and doubling it every day?");
inputString = ReadLine();
howMany = Convert.ToInt32(inputString);
count = 0;
total = START;
while(total == LIMIT)
{
total = total * 2;
count = count + 1;
}
if(howMany >= count)
WriteLine("Your guess was too high.");
else
if(howMany =< count)
WriteLine("Your guess was too low.");
else
WriteLine("Your guess was correct.");
WriteLine("It takes 0 days to reach {1}",
count, LIMIT.ToString("C", CultureInfo.GetCultureInfo("en-US")));
WriteLine("when you double {0} every day",
START.ToString("C", CultureInfo.GetCultureInfo("en-US")));
}
}
In: Computer Science
Given the following code segment, tell the output if it is part of an executable program. Assume the addresses of the variables, a and b, are 0012A32A and 0012A340, respectively.
int* intPtr1, *intPtr2;
int a = 10, b;
intPtr1 = &a;
cout<< "The data in a is "<<a<<endl;
cout << "The address of a is "<<&a<<endl;
cout <<"The data in intPtr1 is "<< intPtr1 <<endl;
cout <<"The data in the variable pointed by intPtr1 is "<< * intPtr1<<endl;
a++;
cout << "After changing a: "<<endl;
cout <<"The data in the variable pointed by intPtr1 is "<< * intPtr1<<endl;
b = *intPtr1;
cout << "The value in b is "<<b<<endl;
a++;
cout << "After changing a: "<<endl;
cout <<"The data in the variable pointed by intPtr1 is "<< * intPtr1<<endl;
cout << "The value in b is "<<b<<endl;
Output:
Please Use C++
In: Computer Science
For this project, you are to modify the Employee class posted on Blackboard by adding a bonus field. The bonus field should be equal to zero when an Employee object is created. You need to add a setter and a getter method to the new bonus field.
The Dirany’s company saves all employee information in the dirany.txt file (attached). The file saves each employee’s information in a new line and all attributes are separated by tabs. For example, the first employee’s information on the first line in the dirany.txt file is as follows:
John Smith 90000
John is the first name of the employee, Smith is the employee’s last name and 90000 is the employee’s annual salary.
Your program should read the dirany.txt file and create an Employee object for each employee in the file, then add the employees to a queue data structure in the same order you read them from the file. The Dirany’s company saves the employees records according to their longevity in the company.
You need to help the Dirany’s company, to calculate the bonus for each employee according to their longevity rule so the bonus of the first employee will be 20% of his/her salary and for each employee afterwards the percent of the bonus will be 1%less so the second employee will get 19% of his/her salary, the third employee will get 18% of his/her salary and so forth.
Your program should access the Employees’ objects in the queue, calculate the bonus field and set it for each Employee object and display the object status: first name, last name, pay and bonus for each employee.
Also your program should calculate and display the number of the employees in the company and the total bonus that the company will pay for all its employees.
Make sure you break up your code into a set of well-defined functions. Each function should include a comment block that briefly describes it, its parameters and any return values.
John Smith 90000 Mathew Marshal 89000 Nicole Lopaz 88200 Adam Benjamin 83400 Julia Hart 82000 Mary Loveland 79000 Varon Bansel 73400 Ali Hassan 63000 Joseph Murty 52000 Ryan Frankel 43400 Julianne Johnson 38600 Noah Expo 22000 Deven Williams 19300 Richard Peal 15200 Lee Wang 14300
in python
In: Computer Science
Please provide steps in order to obtain an ABSOLUTE url to a google image. This ABSOLUTE url should work in an HTML code
In: Computer Science
IT professionals work with many non-IT business partners whose understanding and support are critical to ensuring that IT strategies are implemented and goals are attained.
Imagine you are working with a non-IT partner who does not understand the differences between an analytics database and a data warehouse; nor does your partner understand the effect that the differences have on how you approach data analytics.
Respond to the following in a minimum of 150 words (worth 20 points):
In: Computer Science
How do you find the key that has the most vlaues in it in a dict() useing python?
Example:
{'Zombies Take the Schoolyard': ['Beavers, Kim', 'Frank, Jordan', 'Goodman, Branden', 'Rivera, David', 'Stettler, Sarah'], 'Zompyres: Texas': ['Beck, Stefan', 'Bourland, Cory', 'Burnett, Chase', 'Dumas, Laura', 'Funderburk, Katie'], "2012 Dick's Oddity": ['Attix, Cathy', 'Belville, Bonnie', 'Graciela, Maritza', 'Jakus, Julia', 'Swarts, Nick'], 'CC 2010': ['Coulston, Sabrina'], 'December 21, 2012': ['Faust, Ricky', 'Keep, Tracey', 'Kehayas, Heather', 'Kimball, Elizabeth', 'Walkow, Brett'], 'Venjaxor: 2012!': ['Hueffmeier, Keith', 'Parmentier, Bill', 'Severson, Robert', 'Stroup, Kevin', 'Warner, Ron'], 'Steel of Fire Warriors 2010 A.D.': ['Clarke, Kevin', 'Furback, Jaqi', 'Sheen, Derek', 'Straw, Owen', 'Vogt, Travis']}
With these movies how do I find the the one that had the most actors in it.
Thanks for the help.
In: Computer Science
4.A palindrome is a nonempty string over some alphabet that reads the same forward and backward. Examples of palindromes are all strings of length 1, civic, racecar, abba,…
Give a DP algorithm to find the longest palindrome that is a subsequence of a given input string. What is the running time of your algorithm? (40 points).
•Examples:
•Given the input “character”, your algorithm should return “carac”.
•Given the input “TTATGTGAT”, your algorithm should return “TATGTAT”
Python Code only
In: Computer Science
Make your Curriculum Vitae using MS Word which includes the following heading :objective, academic qualification, field of interest,skills projects and two references and also insert a picture in it.
The Curriculum Vitae should be properly formatted and font styles should be times new roman with single line spacing .
Include your name and roll number in the header field
In: Computer Science
JAVA Write a program that translates a user-input floating-point number between 0 and 4 into the closest letter grade. For example, the number 2.8 (which might have been the average of several grades) would be converted to B–. Break ties in favor of the better grade; for example 2.85 should be a B. NOTE: Your implementation must include the definition/implementation and use/calling of the method numberGradeToLetterGrade that is passed a double numeric grade to its parameter variable, and returns the letter grade.
In: Computer Science
What is the glue, from a client perspective, between a URL and an IP address? Explain how this process works.
In: Computer Science
1a)Giving an array of integers A[1:8] ={5, 1, 3, 2, 7, 6, 8, 4}.
What is the running time of the insertion sort if both A[1..n/2] and A[n/2+1,n] are also sorted. Justify your answer.
2-illustrate the operation of RADIX-SORT on the following list of English words: COW, DOG, SEA, RUG, ROW, MOB, BOX, TAB, BAR, EAR, TAR, DIG, TEA, NOW, FOX.
3-Use counting sort, sort the following numbers: 4, 2, 5, 4, 2, 3, 0, 2, 4, 3
In: Computer Science
Consider the middle 3 digits of your student ID composed of seven digits. Convert it to binary format (each digit is represented by a maximum of 3bits). For example, 1060385 is simplified to 603 and then converted to 110 000 011. Assume now that we want to send your student ID while being able to detect and correct single bit errors. 1.1) Using two-dimensional parity check show what will be transmitted
Consider the middle 3 digits of your student ID composed of seven digits. Convert it to binary format (each digit is represented by a maximum of 3bits). For example, 1060385 is simplified to 603 and then converted to 110 000 011. Assume now that we want to send your student ID while being able to detect and correct single bit errors.
1.1) Using two-dimensional parity check show what will be transmitted codeword using datawords of size 3bits.
1.2) Using the hamming code show what would be the codeword that corresponds to your simplified binary student ID. Dataword size is 9bits.
1.3) Assume that a single bit error occurred and corrupted the 8th bit (numbering starts from 1 and from right). Show that the receiver of such corrupted codeword will be able to correct the error when using the hamming code.
codeword using datawords of size 3bits. 1.2) Using the hamming code show what would be the codeword that corresponds to your simplified binary student ID. Dataword size is 9bits. 1.3) Assume that a single bit error occurred and corrupted the 8th bit (numbering starts from 1 and from right). Show that the receiver of such corrupted codeword will be able to correct the error when using the hamming code.
3 digits 205
hand writing please good
In: Computer Science
In: Computer Science
Develop and test a Python program that converts pounds to grams, inches to centimeters, and kilometers to miles. The program should allow conversions both ways.
In: Computer Science
IT-244: Introduction to Database
*Please, i need Unique answer, use your own words (do not copy and paste).
*Please, do not use handwriting. (no need for picture)
Type your ideas/definitions/examples into the message field to the following discussion prompt:
Discussion Topics:
Assume that you have a Saudi football league player database. In this database, you have a table containing players’ attributes such as (Name, age, position, etc.) and you decided to add information about players’ agents. Would you represent the agent information as attributes in the player table or would you create an entity set for players’ agents? Justify your answer.
Note: Provide answers in your own words. Read the comments of your classmates and post at least TWO responses to their comments.
Marking Criteria:
For your Original Post: Maximum 1 mark
For your Two Responses: Maximum 0.5 mark (0.25 for each response)
In: Computer Science