Polymorphism and Inheritance
Shape.h
class Shape {
string color;
bool filled;
public:
Shape();
Shape(string, bool);
string getColor();
bool isFilled();
void setColor(string);
void setFilled(bool);
string toString();
//virtual string toString();
};
Rectangle.h
class Rectangle : public Shape {
double length;
double width;
public:
Rectangle();
Rectangle(double, double);
Rectangle(double, double, string, bool);
double getLength();
double getWidth();
void setLength(double);
void setWidth(double);
double getArea();
double getPerimeter();
printShape() function prototypes:
void printShape(Shape); or
void printShape(Shape &);
^^test which works correctly
Make a Rectangle class and a Triangle class that extend Shape class
^^not sure how to do this
the main that has to be used
int main() {
Shape s;
Rectangle r(5,6, "red", true);
Triangle t(6, 10, "blue", true);
printShape(s);
Shape s1("blue", false);
printShape(s1);
//add virtual and pass the object by reference
printShape(r);
printShape(t);
return 0;
}
the instances need to be created and printShape() method needs to be called
triangle formula used is =1/2base*height
In: Computer Science
Implement a program to jind out the percentage of the given marks to a student.
In: Computer Science
Please read the discussion article entitled “Top 10 ERP Cost Optimization Ideas” by Gartner and then compose a short response. Address the following two points in your post.
Article
ERP initiatives are associated with high costs. As a result, CIOs look for ways to minimize ERP-related expenses wherever possible. We list 10 ideas for optimizing ERP costs and identify related Gartner publications to help you realize savings.
Key Findings ■ ERP implementation and maintenance is expensive, but necessary for most enterprises.
■ Most CIOs have tried some ERP cost-saving ideas, but often fail to realize the expected savings due to issues with execution.
Recommendations CIOs responsible for postmodern ERP strategies should: ■ Reduce the risk of budget cuts by executing common cost optimization approaches before pursuing more drastic measures that may inhibit ERP benefits realization. ■ Get in-depth information on cost-saving ideas to improve ERP execution, savings and value realization by studying the Gartner publications referenced in this document.
Introduction
Optimization of IT costs is an undertaking that CIOs frequently pursue in order to manage expenses and ensure investments deliver maximum value. Since ERP represents one of the largest investments that an IT department makes, it is the focus of this document. Some ERP cost optimization ideas provide short-term savings, but with the trade-off of higher costs and technical debt later. Other ideas may provide radical savings at the risk of significant business disruption or failure. Before attempting drastic measures, CIOs should explore the 10 ERP cost optimization ideas in this document to determine which provide the best recurring and consistent year-over-year savings for their organization, along with limited or manageable risks. What are the main ways to optimize ERP costs and how can CIOs choose the best options for their organization? A vital component of successful cost optimization is continuous evaluation of new ideas. It's also crucial to drive current efforts forward in order to continue value realization and track cost savings. As new IT products, services and approaches emerge, so too do opportunities to realize greater benefits and save more money. Cost optimization should be pursued as a collaborative effort between the IT department and the business. While some ideas impact the IT department primarily, others will require the engagement and buy-in of the business in order to succeed. Establish an ERP cost optimization process to ensure the ideas you are applying result in the expected ERP benefits and expense reductions (see "Toolkit: Postmodern ERP Cost Optimization"). This list of 10 ideas focuses on actions that CIOs can take to enable cost savings related to their ERP initiative (see Figure 1). Some of the ideas are cost-cutting measures designed primarily to meet cost reduction targets, and have minimal impact on quality and service. Others provide moderate cost savings, while delivering more significant ERP benefits in terms of agility, flexibility or scalability, or a new set of features and services.
Analysis
1. Move ERP Solutions to Cloud-Hosted IaaS One of the most popular ways to optimize costs is to move the hosting of ERP applications from on-premises data centers to cloud-hosted infrastructure as a service (IaaS) providers such as Amazon Web Services and Microsoft (Azure). A "lift and shift" approach can provide cost savings, while minimizing business disruption by avoiding the more significant time and investment required for a full switch to a SaaS application. In addition to cost savings, IaaS has the potential to improve scalability, flexibility and agility. The following Gartner publications provide further information on shifting to IaaS and maximizing savings: ■ "Three Moves for CIOs to Lower Business Costs With Cloud" ■ "10 Best Practices for Azure Cloud IaaS Cost Optimization" ■ "Seven Deadly Sins of I&O Cost Optimization and Transformational Investment" ■ "Magic Quadrant for Public Cloud Infrastructure Managed Service Providers, Worldwide" 2. Use Third-Party ERP Software Support Services CIOs that use third-party ERP software support services typically see at least a 50% reduction in the cost of vendor maintenance agreements. However, there are trade-offs, and third-party support is not available in all cases, such as for SaaS ERP, where support services are built into the subscription fee. With major ERP vendors shifting their investment to cloud products, some clients have felt a reduction in the quality of on-premises software support and a diminishing return on their maintenance spending. Study the following Gartner publications if you want to explore the use of third-party ERP software support services: ■ "What to Consider Before Canceling Your ERP Vendor's Maintenance Agreement and Switching to Third-Party Support" ■ "Does Third-Party Support Have a Role in Your Postmodern ERP Strategy?" ■ "How to Get a Great Deal on Third-Party Support for Application Software" ■ "Two Best Practices to Mitigate the Risks of Adopting Third-Party Support for Oracle and SAP ERP" ■ "What Rimini Street and Spinnaker Support Are Doing to Support Oracle and SAP ERP Products"
3. Standardize Processes, Data and Configuration Across Organizational Groups Processes, data and configuration across groups within an organization frequently become fragmented due to operational silos or changes over time. Standardization can deliver value and efficiency through adoption of best practices. This may take place within a single ERP instance that is configured with multiple business units. Those business units may use functionality in different ways to support processes that are not truly unique or do not provide value-added differentiation. There may also be multiple ERP instances supporting each process. Standardizing the underlying processes will enable the application consolidation covered in the next idea. CIOs that partner with business leaders to implement standardization will realize cost optimizations inside the IT department and across the whole organization. For more insight into this savings opportunity, see the following Gartner publications: ■ "Postmodern ERP: Why Process Standardization Isn't the Same as Best Practice, and Why You Need Both" ■ "ERP Consolidation: Standardizing Processes and Evaluating Your Options" ■ "When Application Standardization Works, and When It Doesn't" ■ "Establish a Standardization Mindset for Success With SaaS ERP Solutions" 4. Consolidate ERP Application Instances Frequently, an organization's standardization of processes, data and configuration across groups facilitates technical consolidation of ERP application instances. Proliferation of these instances may result from mergers, acquisitions or the growth of independent business units over time. For CIOs who nd themselves with numerous ERP instances, consolidation can optimize costs by minimizing redundancy in infrastructure, maintenance and support, while simplifying the application landscape and reducing integrations. This can also enable the deployment of an IT shared-service model, leading to further cost savings. For additional information on consolidating ERP application instances, see the following Gartner publications: ■ "How to Approach Postmodern ERP Instance Consolidation" ■ "Two-Tier ERP Meets the Needs of a Protectionist Business Era" ■ "Use Gartner's Pace-Layered Application Strategy to Clean Up ERP During Upgrades and Consolidation" ■ "Apply These Best Practices for Application Consolidation" ■ "In Application Rationalization, the Number of Applications Is Irrelevant"
5. Move Core ERP Functions to SaaS Solutions Implementing a SaaS solution for certain core ERP functions can provide short-term cost savings and smooth out annual expenditure on ERP. This is because some vendors offer attractive discounts on initial SaaS contracts. On-premises ERP solutions have higher short-term costs, such as for purchasing perpetual licenses and local data center infrastructure. These costs are followed by significant spikes in spending in certain years when a major upgrade is needed to the software or hardware. A shift to SaaS solutions avoids spikes by spreading costs evenly over the duration of a subscription. Major ERP vendors are dedicating more research and development funds to SaaS solutions than to on-premises products. CIOs whose current ERP solution is not meeting business needs or is too expensive should consider a move to SaaS solutions that now have feature-parity in core functions such as human capital management, nance and procurement. For more details on optimizing costs with SaaS ERP, see the following Gartner documents: ■ "Toolkit: Minimize SaaS Risk and Cost Using This Toolkit to Efficiently Negotiate Optimal SaaS Contract Terms and Conditions" ■ "SAP SaaS: Minimize Unbudgeted Costs and Risk by Negotiating Six High-Impact Terms" ■ "Improve Your Enterprise SaaS Implementation With This Three-Step Process and Checklist" 6. Scrutinize Lifetime Costs and Values While Prioritizing "Continuous Improvement" ERP Initiatives The cost of ERP initiatives can grow during implementation and after deployment because of customizations and configurations. These changes create technical debt by increasing upgrade effort, system complexity and testing. But they can also provide much needed functionality to support differentiated business processes. It's important to prioritize continuous-improvement changes through governance to provide the greatest value and benefits, with consideration of lifetime costs. The following Gartner documents examine how to prioritize the right improvements and realize benefits: ■ "Build a Culture of Continuous Improvement to Take Advantage of the Regular Updates of SaaS ERP" ■ "Stop Chasing Rainbows and Unicorns: Learn From ERP History to Maximize the Value of Postmodern ERP Strategies" ■ "An ERP Design Authority Plays a Key Role in Governance" ■ "Postmodern ERP Benefits Realization — Chasing the 'Pot of Gold'" ■ "Realizing Postmodern ERP Benefits Requires a Focus on Value Measurement"
7. Automate All ERP Application-Testing Activities ERP application testing has high costs in terms of time and effort, due to the breadth of functionality that ERP covers, the tightly integrated nature of ERP applications, and the resulting large number of test cases. A shift to quarterly software updates by many vendors has placed an even greater burden on the IT department and the business to complete testing quickly. Automating ERP application testing relieves that burden and can result in a faster and cheaper process that still meets quality assurance demands. Software-testing automation tools have short-term costs for deployment and training, but can deliver great value relatively quickly. CIOs looking to adopt automated ERP testing should read the following Gartner documents to learn more about the process and the key tools they will need: ■ "The Eight Essentials When Moving to Automated Software Testing" ■ "Use Layered Testing to Enable Continuous Delivery of Digital Business Capabilities" ■ "Magic Quadrant for Software Test Automation" ■ "Critical Capabilities for Software Test Automation" 8. Remove Unused or Low-Value Custom Developments and Replace Other Customizations With Standard Package Functionality Although prioritizing continuous-improvement ERP initiatives can lead to cost optimization, it's important to revisit those changes and older customizations periodically to determine whether there is now standard functionality to meet the same needs, such as in a recent vendor release. Customizations that are not being used or not delivering expected benefits should be removed or replaced. Studying the following Gartner documents will help you devise a customization strategy and manage previous changes to your ERP applications: ■ "Define Your Customization Strategy for SaaS/Cloud Business Applications" ■ "Manage ERP Customizations, Don't Avoid Them" ■ "Hybrid ERP Demands a Different Approach to Managing Customizations" ■ "Customization: The Cost That Keeps on Costing" 9. Utilize Citizen Developers and Create a Stronger Superuser Network to Save on Support, Development and Testing IT staff face a challenge to meet the support and development needs of users who are moving into the world of digital business. CIOs looking to optimize costs should partner with business leaders and end users to shift some of that effort to citizen developers and superuser support networks outside the traditional IT organization, which has higher personnel expenditure on average.
Improvements in easy-to-use tools and the digital skills of business users enable this savings opportunity. Read the following Gartner publications to gain greater insight into superusers and citizen developers: ■ "Invest in the Superuser Role to Improve ERP Support" ■ "Best Practices for Managing the ERP Superuser Network" ■ "Citizen Development Is Fundamental to Digital Transformation" ■ "Good Citizen IT App Development Security Depends on Good IT Citizenship" ■ "Survey Analysis: Citizen Development Is Happening and IT Needs to Be More Engaged" 10. Outsource ERP Application Development, Maintenance or Service Desk to Offshore Locations Another way to move further away from potentially costly in-house IT resources is through outsourcing to offshore locations. CIOs have optimized costs by shifting ERP application development, maintenance and service desk functions to geographic areas with lower labor costs. This may be accomplished through managed service providers or by setting up internal ofces offshore. The following Gartner documents give further details on how to approach this option: ■ "Best Practices for Contracting and Managing Outsourced Software Factories" ■ "How to Make Bad Outsourcing Deals Better" ■ "Toolkit: Negotiate More Effectively Using Key Labor Rates for IT Application Outsourcing Deals" ■ "Investing in Transition Planning Will Maximize Success for Managed Services Outsourcing Deals" ■ "Essential Metrics for Outsourcing Testing Services" Further Ideas and Next Steps In addition to these 10 ideas, there are many other approaches to reducing costs associated with ERP. New technologies such as artificial intelligence, blockchain and the Internet of Things have the potential to change the ERP landscape and deliver dramatic savings, while offering new benefits and driving digital business transformation (see "Predicts 2018: Postmodern ERP Evolves to Support Digital Business, Investments Must Be Evaluated Cautiously"). Explore the 10 ideas in the present document, while continuously evaluating new technologies and services. An ongoing focus on optimizing ERP costs and measuring savings through a defined process will improve results and ensure opportunities are not missed.
In: Computer Science
Question 3: Answer the following short question
Questions 3(a): A milk producing factory has four sensors,
First sensor (A) checks the color of milk and if the color is good it turns ON.
Second sensor (B) checks if the label (sticker) of company is correctly pasted and turns ON.
Third sensor (C) checks if the cap of bottle is properly closed and turns ON.
Fourth sensor (D) checks if the weight of the bottle is correct and turns ON if it is correct.
The bottle is shipped when any three of the four sensors are turned ON.
X= ABC+ ABC+ABC+ABC
pls answer q3 3a and 3b
In: Computer Science
In C Please
*Asked before but all previous answers do not work correctly*
10.6 LAB: Warm up: Parsing strings
(1) Prompt the user for a string that contains two strings separated by a comma. (1 pt)
Ex:
Enter input string: Jill, Allen |
(2) Report an error if the input string does not contain a comma.
Continue to prompt until a valid string is entered. Note: If
the input contains a comma, then assume that the input also
contains two strings. (2 pts)
Ex:
Enter input string: Jill Allen Error: No comma in string. Enter input string: Jill, Allen |
(3) Extract the two words from the input string and remove any spaces. Store the strings in two separate variables and output the strings. (2 pts) Ex:
Enter input string: Jill, Allen First word: Jill Second word: Allen |
(4) Using a loop, extend the program to handle multiple lines of
input. Continue until the user enters q to quit. (2 pts)
Ex:
Enter input string: Jill, Allen First word: Jill Second word: Allen Enter input string: Golden , Monkey First word: Golden Second word: Monkey Enter input string: Washington,DC First word: Washington Second word: DC Enter input string: q |
In: Computer Science
Q1.Convert C46C000016 into a 32-bit single-precision IEEE floating-point binary number.
In: Computer Science
You were given a kettle of n birds, which look all the same to you. To decide if two birds are of the same species, you perform the following experiment – you put the two of them in a cage together. If they are friendly to each other, then they are of the same species. Otherwise, you separate them quickly before survival of the fittest kicks in.
1. Suppose that there are exactly p species present in your kettle of n birds. and one species has a plurality: more birds belong to that species than to any other species. Present a procedure to pick out the birds from the plurality species as efficiently as possible (i.e., minimize the number of experiments you have to do as a function of n and p). Do not assume that p = O(1).
In: Computer Science
1. Write three command statements to back up the `Orders` Table for data only, structure with data and structure only using mysqldump. 2. Write the command statement to import the data using mysqlimport from customers.csv file. 3. What's the difference to use the LOAD DATA LOCAL INFILE vs mysqlimport. 4. Write SQL statements: a. Create a database user "cis495_dev1" with password "dolphins". b. Create the database "cis495Demo". c. Grant user "cis495_user1" with "select" ,"delete" and "execute" permission to DB "cis495Demo". d. Revoke the privilege "delete" for the user "cis495_user1". 5. List three ways ( SQL statement: update, alter, set) to change the password from "dolphines" to "icando" for the user "cis495_user1". 6. Explain the difference between user and role.
In: Computer Science
Explain how to handle null values and default values when coding INSERT and UPDATE statements. Give examples.
In: Computer Science
In: Computer Science
Objectives
• Use the static methods and static fields.
•Use the method-call/return mechanism.
• Use the random-number generation.
• Overload methods. Problem Specification
Write a program that lets a user play "Rock, Paper, Scissors" against the computer or computer against computer. In user-computer game, the program should ask the user to choose one of the three choices, and then the computer randomly picks one (without knowing what the user has chosen). For this problem, the user should be asked to enter an integer: 1 for rock, 2 for paper, 3 for scissors. Rock beats scissors, scissors beats paper, paper beats rock. The program should say who wins, and then keep playing until someone (the user or the computer) has won 5 rounds. The computer needs to keep track of the current score and should also display it before each round. In computer-computer game, play for 100 rounds and display which object won majority of the times.
Design Specification
• Create Java class RPS.
• Create static variables for storing Score1 and Score2.
• Create a static method getRandom to get random integer between 1 and 3.
• Overload play method like in the below screenshot.
• Play() is for computer vs computer, play(userchoice) is for user vs computer.
in Java, please
In: Computer Science
def repeat(string, n, delim)
that returns the string string repeated n times, separated by the string delim. For example repeat(“ho”, 3, “,”) returns “ho, ho, ho”.
keep it simple.Python
In: Computer Science
Question II:
L= {0n10n | n ≥1}
In: Computer Science
Reverse Polish (HP) Style Calculator - Part 2
The purpose of this assignment is to incorporate an abstract class and inheritance and add it to the interface of the business calculator created in Topic 4.
• Implement a pure abstract stack class named AbstractStack that has no implementation. It will not have a private array of double, because that is an implementation detail of ArrayStack that would not be found in other implementations such as LinkedStack. Nor will it have the constructor public AbstractClass(int size), or methods public double peek(int n) or public int count(), since these methods are convenience features that are easily implemented for ArrayStack, but not other implementations of stack.
• Include the method public double peek(), and add the method public void clear(), resulting in the following abstract methods.
o public abstract void push(double item) – Standard stack action; Throws an exception if the stack is full.
o public abstract double pop() – Standard stack action; Throws an exception if the stack is empty.
o public abstract boolean isEmpty() – Returns true if the stack is empty and false otherwise.
o public abstract double peek() – returns the value of the item located at the specified position on the stack; throws an exception if the array bounds are exceeded or if a nonexistent element is requested.
o public abstract void clear() – empties the stack if it is not already empty.
• Do not specify a constructor. Depend on the default constructor.
• Modify the existing ArrayStack.java file to include the phrase "extends AbstractStack."
• Add an implementation for the methods void clear() and double peek(), which overloads the existing double peek(int n). Provide a default constructor that creates an array that will hold three elements.
o public ArrayClass(int size) - constructor that creates an ArrayClass instance containing an array of the specified size. Remember that in Java, arrays are indexed from 0!
o public push(double item) – standard stack action; throws an exception if the array bounds are exceeded.
o public double pop() – standard stack action; throws an exception if the array bounds are exceeded.
o public boolean isEmpty() – returns true if the stack is empty and false otherwise.
o public double peek(int n) – returns the value of the item located at the specified position on the stack; throws an exception if the array bounds are exceeded or if a nonexistent element is requested; peek(0) will return the top element of the stack.
o public int count() - returns the number of items currently pushed onto the stack.
• Modify the existing TestArrayStack.java file to include tests for void clear() and double peek(). Note that it is easiest to do "incremental testing" in which you code a little then test a little.
• Create an interface with additional methods.
• Create a new file called Forth.java. Make this a publicinterface file. Add the following methods to the interface.
o public add() – pops two values from the stack, adds them together, and pushes the result back onto the stack. Throws an exception if there are not at least 2 items on the stack.
o public sub() – pops two values from the stack, subtracts the second number popped from the first number popped, and pushes the result back onto the stack. Throws an exception if there are not at least 2 items on the stack.
o public mult() – pops two values from the stack, multiplies them together, and pushes the result back onto the stack. Throws an exception if there are not at least 2 items on the stack.
o public div() – pops two values from the stack, divides the second number popped by the first number popped, and pushes the result back onto the stack. Throws an exception if there are not at least 2 items on the stack.
o public dup() – peeks at the top value on the stack and pushes a copy of that value onto the stack. Throws an exception if the stack is empty or full.
o public twoDup() – peeks at the top two values on the stack and pushes a copy of both values onto the stack (in the same order). Throws an exception if the stack does not have at least 2 items or room for 2 additional items.
• Create another file called ForthStack.java. Make this file extend ArrayStack and implement Forth. Code concrete implementations of each of the methods in the interface.
• Test by making a copy of the file TestArrayStack.java and name it TestForth. Change the name of the class inside the file. Add tests for add, sub, mult, div, dup, and twoDup.
• After thoroughly testing the program, submit the AbstractStack.java, ArrayStack.java, Forth.java, ForthStack.java, and TestForthStack.java files to the instructor.
Previous Array Stack
public class ArrayStack
{
private double[] array;
private int size;
private int num;
public ArrayStack(int a){
array = new double[a];
size = a;
num = 0;
}
public void push(double a){
if (num < size){
array[num] = a;
num++;
System.out.println("Success");
}
else {
System.out.println("Failure! Stack is full");
}
}
public double pop(){
if (num > 0){
num--;
return array[num];
}
else {
System.out.println("Stack is empty");
return -1;
}
}
public boolean isEmpty(){
return (num == 0);
}
public double peek(int n){
try
{
if (num > 0)
{
if (n < 0 || n >= num)
return -1;
else
return array[num-1-n];
}
else
{
System.out.println("Stack is empty");
return -1;
}
}
catch(Exception e ){
e.printStackTrace();
}
return 0;
}
public int count(){
return num;
}
}
Previous Test Array Stack
public class TestArrayStack{
public static void main(String [] args)
{
int choice;
int peek;
double val,poped;
boolean empty;
Scanner sc =new Scanner(System.in);
ArrayStack as = new ArrayStack(20);
while(true){
System.out.println("1. Enter a
Value in stack");
System.out.println("2. Pop a
Value");
System.out.println("3. Check If
array is Empty");
System.out.println("4. Peek
Function");
System.out.println("5.
Exit\n");
choice = sc.nextInt();
switch(choice)
{
case 1:
System.out.print("Enter a value To
push : ");
val = sc.nextDouble();
as.push(val);
break;
case 2:
poped = as.pop();
System.out.println("Popped :
"+poped);
break;
case 3:
empty = as.isEmpty();
System.out.println("Empty ?
"+empty);
break;
case 4:
System.out.print("Enter a index to
peek : ");
peek = sc.nextInt();
poped = as.peek(peek);
if(poped != -1)
System.out.println("Peeked Value :
"+poped);
else
System.out.println("Oops it was not
a valid index this place is empty");
break;
case 5:
System.exit(0);
}
}
}
}
What I need is AbstractStack.java, ArrayStack.java, Forth.java, ForthStack.java, and TestForthStack.java
Thank you
In: Computer Science