## (Solved) : Use Sandwich Theorem Problems 7 8 9 9 Lim Tan 10x 15x Q30789593 . . .

Use the Sandwich Theorem in problems #7,#8,#9 #9 lim tan (10x) 15x Show transcribed image text

## Expert Answer

. . .

READ MOREUse the Sandwich Theorem in problems #7,#8,#9 #9 lim tan (10x) 15x Show transcribed image text

. . .

READ MOREuse screenshots + clear explanation please.

questions about Soccer and Video games.

? HW#1: Come up with two interesting questions

that you can answer using Google Trends and

1. Define your problem

2. Describe what data you would need and how you get them

3. Briefly explain how you think you can solve the question

. . .

READ MOREUse the sample code below to write a program that calculate compound interest .The comments (// …) give you hints about the code you need to add to make the program work. using System;namespace CompoundInterestCalculator { public class CompoundCalculator { const int EXIT = 0; const int CALCULATE_DAILY = 1; const int CALCULATE_QUARTERLY = 2; const int CALCULATE_VARIABLE = 3; const int NUM_OPTIONS = 3; public static void Main() { int menuOption; WelcomeMessage(); do { DisplayMenu(); menuOption = ReadOption(); if (menuOption != EXIT) { double finalAmount = CalculateInterest(menuOption); OutputResult(finalAmount); } } while (menuOption != EXIT); ExitProgram(); } // end Main // Fill in the appropriate modifier and return type (_ _) in the method declaration public _ _ WelcomeMessage() { Console.WriteLine(“nntCompound Interest Calculatorn”); } // end WelcomeMessage // Fill in the appropriate modifier and return type (_ _) in the method declaration public _ _ ExitProgram() { Console.Write(“nnPress enter to exit.”); Console.ReadLine(); } // end ExitProgram static void DisplayMenu() { string menu = “nn1) Calculate final amount after interest (compounded daily)” + “n2) Calculate final amount after interest (compounded quarterly)” + “n3) Calculate final amount after interest (define number of times compounded yearly)” + “nnEnter your option(1-3 or 0 to exit): “; Console.Write(menu); } // end DisplayMenu public static void OutputResult(double finalAmount) { // Display the message “The final amount of money plus interest is: $(amount)” // The amount should display as currency, with two decimal places, e.g. $10,000.00 } // end OutputResult static int ReadOption() { string choice; int option; bool okayChoice; do { choice = Console.ReadLine(); okayChoice = int.TryParse(choice, out option); if (!okayChoice || option < 0 || option > NUM_OPTIONS) { okayChoice = false; Console.WriteLine(“You did not enter a correct option.nn Please try again”); DisplayMenu(); } } while (!okayChoice); return option; } // end ReadOption public static double CalculateInterest(int menuOption) { // (For this exercise, we will assume the user is inputting correct input.) double principal; double interestRate; int numYears; double finalAmount; Console.Write(“Enter the principal amount: “); principal = Double.Parse(Console.ReadLine()); Console.Write(“Enter the interest rate: “); interestRate = Double.Parse(Console.ReadLine()); Console.Write(“Enter the number of years that interest is accumulated for: “); numYears = Int32.Parse(Console.ReadLine()); if (menuOption == CALCULATE_DAILY || menuOption == CALCULATE_QUARTERLY) { if (menuOption == CALCULATE_DAILY) { // Call the appropriate CalculateCompoundInterest method } else { // Call the appropriate CalculateCompoundInterest method } } else { Console.Write(“Enter the number of times the interest is compounded yearly: “); int numTimesCompounded = Int32.Parse(Console.ReadLine()); // Call the appropriate CalculateCompoundInterest method } Console.WriteLine(); // return the amount calculated by the compound interest method } // End CalculateInterest // Declare and implement the method CalculateCompoundInterest whose parameters are the principal, interest rate, and number of years (in that order)- make sure it is public! // For the declaration select an appropriate modifier, return type, and types for the parameters // This version assumes the interest is compounded daily (365 times a year) // Declare and implement the method CalculateCompoundInterest whose parameters are the principal, interest rate, number of years, and number of times compounded yearly – make sure it is public! // For the declaration select an appropriate modifier, return type, and types for the parameters // This version allows the number of times compounded yearly to be specified. }//end class}//end namespace

Write a program in C# that calculates compound interest The formula for compound interest is: A P+(r/m) Where ·A = Accrued Amount (principal plus interest) ·P-Principal Amount · r Annual interest rate (as decimal) · t = Number of years · Number of times interest is compounded per year Write the program using methods. Finish the method heading of two methods – WelcomeMessage0 and ExitProgram0 – by selecting the appropriate moditfiers and return types, and finish the header and method body of OutputResult0. Finally, implement two CalculateCompoundInterest0 methods which calculate the accrued amount – one which takes as parameters the principal, interest rate, and number of years accumulating interest, and assumes the number of times interest is compounded per year is daily (365), and another that allows the number of compounds per year to be specified Your code will be run by calling the two versions of the CalculateCompoundInterest0 method, OutputResult0 and ExitProgram0 methods directly. As a result, make sure you make these methods public. Show transcribed image text Write a program in C# that calculates compound interest The formula for compound interest is: A P+(r/m) Where ·A = Accrued Amount (principal plus interest) ·P-Principal Amount · r Annual interest rate (as decimal) · t = Number of years · Number of times interest is compounded per year Write the program using methods. Finish the method heading of two methods – WelcomeMessage0 and ExitProgram0 – by selecting the appropriate moditfiers and return types, and finish the header and method body of OutputResult0. Finally, implement two CalculateCompoundInterest0 methods which calculate the accrued amount – one which takes as parameters the principal, interest rate, and number of years accumulating interest, and assumes the number of times interest is compounded per year is daily (365), and another that allows the number of compounds per year to be specified Your code will be run by calling the two versions of the CalculateCompoundInterest0 method, OutputResult0 and ExitProgram0 methods directly. As a result, make sure you make these methods public.

. . .

READ MOREUse the Scanner class to read them into double variables.Print out the result of the four basic arithmeticoperations (addition, subtraction, multiplication, anddivision) on the two numbers

. . .

READ MORE? Use Sage to explore this.:

For what positive integers n does the decimal expansion for 1 nend in all zeros?

2. For what positive integers n does the decimal expansion for end in all zeros? Use Sage 100, and to explore this. I suggest making a chart of the decimal expansions for n then look for patterns. Show transcribed image text

. . .

READ MOREHow to use scanf to read numbers only?

Imagine I want an integer with four digits from scanf, and thenbreak it into an character array with four elements.

I have

scanf(“%d”,&guess);

for (k = 3; k >=0; k–) {

guessArray[k] = (guess % 10)+’0′;

guess = guess / 10;}

to make integer 1234 into array[4]={‘1’, ‘2’, ‘3’, ‘4’};

If I want all invalid character (that is a character not between0 and 9) to be silently ignored

for example, when I type 1a2b3c4d as input, I can still get thecharacter array as array[4]={‘1’, ‘2’, ‘3’, ‘4’};

what should I do?

Many thanks!!!

. . .

READ MOREUse the rules of inference and the laws of propositional logicto prove that each argument is valid. Number each line of yourargument and label each line of your proof “Hypothesis” or with thename of the rule of inference used at that line. If a rule ofinference is used, then include the numbers of the previous linesto which the rule is applied.

(a)

p → q

q → r

¬r

∴ ¬p

(b)

p → (q ∧ r)

¬q

∴ ¬p

(c)

(p ∧ q) → r

¬r

q

∴ ¬p

(d)

(p ∨ q) → r

p

∴ r

(e)

p ∨ q

¬p ∨ r

¬q

∴ r

(f)

p → q

r → u

p ∧ r

∴ q ∧ u

. . .

READ MOREUse the School table tocreate a query that lists the schools that are either located in anurban area with a population of at least 250,000 (ULOCAL=11) or arecharter schools (CHARTR=1). Show the school name, phone, city,ULOCAL and CHARTR. Order the results by City. Name the query “Largeor Charter” (without the quotes). [11 points]

. . .

READ MOREUse rules of inference to show that ifvxP(x) v Q(x)) and yt( P(x) л Q(x)) → R(x)) are true, then Vx( R(x) → P(x)) is also true, where the domains of all quantifiers are the same. Show transcribed image text

. . .

READ MOREHow I use the selection sort to classes by fill rate inascending order for this source code

#include<iostream>

#include<string>

#include<fstream>

#include<iomanip>

#define MAX 100

using namespace std;

void outputHead();

int getdata(ifstream& infile,string crn[],stringclassname[],int cenrollment[],int maxenrollment[],intwaitlist[]);

void output(string crn[],string classname[],intcenrollment[],int maxenrollment[],int waitlist[],doublefillrate[],int size);

void calculateAverageFillRate(double fillrate[],int size,intmaxenrollment[],int cenrollment[]);

void sortselection(string crn[],string classname[],intcenrollment[],int maxenrollment[],int waitlist[],doublefillrate[],int size);

int main()

{

ifstream infile;

string classname[MAX];

string crn[MAX];

int cenrollment[MAX],maxenrollment[MAX],waitlist[MAX];

double fillrate[MAX];

int size,totalCount;

infile.open(“Lab7FillRates.txt”);

if(!infile)

{

cout << “No such file!” << endl;

}

outputHead();

size=getdata(infile,crn,classname,cenrollment,maxenrollment,waitlist);

calculateAverageFillRate(fillrate,size,maxenrollment,cenrollment);

output(crn,classname,cenrollment,maxenrollment,waitlist,fillrate,size);

sortselection(crn,classname,cenrollment,maxenrollment,waitlist,fillrate,size);

return 0;

}

/////////////////////////////////////////

void outputHead()

{

ofstream f;

f.open(“Lab 7 output.txt”);

f << “CRN” << setw(15) << “Course” <<setw(25) << “CurrentEnrollment” << setw(25) <<“MaxEnrollment” << setw(25) << “Number of WaitList”<< setw(15) << “FillRate” << endl;

f.close();

cout << “CRN” << setw(15) << “Course” <<setw(25) << “CurrentEnrollment” << setw(25) <<“MaxEnrollment” << setw(25) << “Number of WaitList”<< setw(15) << “FillRate” << endl;

}

/////////////////////////////////////////

int getdata(ifstream& infile,string crn[],stringclassname[],int cenrollment[],int maxenrollment[],intwaitlist[])

{

/*

Pre: infile – reference to the datafile

crn[] – array of CRN

classname[] – array of ClassName

cenrollment[] – array of CurrentEnrollment for the class

maxenrollment[] – array of MaxEnrollment for the class

waitlist[] – array of Number of students on waiting list for theclass

Post: Fill Rate on CIS department in DE ANZA

Purpose: To input the information from data file

*/

int count = 0;

while ( count < MAX && !infile.eof())

{

string s;

string m,n;

int o,p,q;

infile >> s >> m >> n >> o >> p>> q;

crn[count] = s;

classname[count] = m+” “+n;

cenrollment[count] = o;

maxenrollment[count] = p;

waitlist[count] = q;

count++;

}

return count;

}

////////////////////////////////////////////////

void calculateAverageFillRate(double fillrate[],int size,intmaxenrollment[],int cenrollment[])

{

/*

Pre: fillrate[] – array of Fill Rates

cenrollment[] – array of CurrentEnrollment for the class

maxenrollment[] – array of MaxEnrollment for the class

size –

Post:

Purpose:

*/

double a=0;

for(int i=0; i<size; i++)

{

float max = (float)maxenrollment[i];

float st = (float)cenrollment[i];

double b = (st/max)*100;

fillrate[i] = b;

}

}

////////////////////////////////////////////////

void sortselection(string crn[],string classname[],intcenrollment[],int maxenrollment[],int waitlist[],doublefillrate[],int size)

{

for (int i=0; i < size; i++)

{

for (int j; j< size-i;j++)

{

if (fillrate[j] > fillrate[j+1])

{

int temp=fillrate[j];

fillrate[j]=fillrate[j+1];

fillrate[j+1]=temp;

}

}

}

return ;

}

///////////////////////////////////////////////

void output(string crn[],string classname[],intcenrollment[],int maxenrollment[],int waitlist[],doublefillrate[],int size)

{

/*

Pre: infile – reference to the datafile

crn[] – array of CRN

classname[] – array of ClassName

cenrollment[] – array of CurrentEnrollment for the class

maxenrollment[] – array of MaxEnrollment for the class

waitlist[] – array of Number of students on waiting list for theclass

fillrate[] – array of FillRate about the class

size – size of our class

Post: nothing

Purpose: To input the information to screen

*/

ofstream f;

f.open(“Lab 7 output.txt”,ios::app);

for (int i=0; i < size-1; i++)

{

f << crn[i] << setw(17) << classname[i]<< setw(13) << cenrollment[i] << setw(27)<< maxenrollment[i] << setw(23) << waitlist[i]<< setw(20) << fillrate[i] << endl;

}

f.close();

for (int i=0; i < size-1; i++)

{

cout << crn[i] << setw(17) << classname[i]<< setw(13) << cenrollment[i] << setw(27)<< maxenrollment[i] << setw(23) << waitlist[i]<< setw(20) << fillrate[i] << endl;

}

return;

}

. . .

READ MORECoursehelp™ | Assignments solutions - Copyright© 2019